package com.ruoyi.system.outto.goods.impl;


import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.exception.GlobalException;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.http.HttpUtils;
import com.ruoyi.system.V2.gameAttr.mapper.GameAttrTemplateMapper;
import com.ruoyi.system.V2.gameAttr.mapper.GameAttributeMapper;
import com.ruoyi.system.V2.gameAttr.service.IGameAttributeService;
import com.ruoyi.system.V2.goodInfo.mapper.GoodsInfoImgMapper;
import com.ruoyi.system.V2.inter.mapper.ArtRecMapper;
import com.ruoyi.system.interAttr.domain.InterAttr;
import com.ruoyi.system.interAttr.mapper.InterAttrMapper;
import com.ruoyi.system.model.domain.*;
import com.ruoyi.system.model.dto.GoodsInfoAndAttrValueDto;
import com.ruoyi.system.outto.core.OutUrlConstant;
import com.ruoyi.system.outto.goods.IHuanHaoBaApi;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.beanutils.ConvertUtils;
import org.apache.commons.codec.digest.DigestUtils;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.lang.reflect.Field;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;

@Slf4j
@Service
public class HuanHaoBaApiImpl implements IHuanHaoBaApi {
    @Resource
    private GoodsInfoImgMapper goodsInfoImgMapper;
    @Resource
    private IGameAttributeService gameAttributeService;
    @Resource
    private ArtRecMapper artRecMapper;
    @Resource
    private GameAttributeMapper gameAttributeMapper;
    @Resource
    private GameAttrTemplateMapper gameAttrTemplateMapper;
    @Resource
    InterAttrMapper interAttrMapper;

    @Override
    public AjaxResult addAndEditAndDelGame(GoodsInfoAndAttrValueDto goodsInfoAndAttrValueDto, String doType, SalePartner sa) {


        Map<String, Object> hhbDto = params(goodsInfoAndAttrValueDto, doType,sa);
        String json = JSONObject.toJSONString(hhbDto);
        Map<String, String> hashMap = new HashMap<>();
        hashMap.put("data", json);
        hashMap.put("sign", DigestUtils.md5Hex(json + sa.getSaleKey()));
//        log.info(hashMap);
        log.info("换号吧新增请求参数={}", json);
        String response = "";
        if(doType.equals("del")) {
            boolean flag = true;
            int count = 0;
            while (flag) {
                response = HttpUtils.doPostForm("https://api.huanhaoba.com/api/pushProduct", hashMap, null);
                try {
                    Thread.sleep(2000l);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                JSONObject resultJson = JSONObject.parseObject(response);
                String code = resultJson.getString("code");
                if (Objects.equals("500", code) && count <= 3) {
                    flag = true;
                } else {
                    flag = false;
                }
                count++;
            }
        }else {
            response = HttpUtils.doPostForm("https://api.huanhaoba.com/api/pushProduct", hashMap, null);
        }
        log.info("{}", response);
        JSONObject resultJson = JSONObject.parseObject(response);

        Map<String, Object> result = new HashMap<>();

//        if (StringUtils.isEmpty(resultJson)) {
//            result.put("code", 500);
//            result.put("req", JSONObject.toJSONString(hashMap));
//            result.put("res", response);
//            result.put("msg", "图片存有特殊字符串,换号吧不允许新增或者编辑");
//            return AjaxResult.success(result);
//        }
        String msg = resultJson.getString("msg");
        if (!resultJson.getBoolean("succ")) {
            result.put("code", 500);
        } else {
            result.put("code", 200);
            result.put("outId", goodsInfoAndAttrValueDto.getId());
        }

        result.put("req", JSONObject.toJSONString(hashMap));
        result.put("res", response);
        result.put("msg", msg);
        return AjaxResult.success(result);
    }

    private Map<String, Object> params(GoodsInfoAndAttrValueDto goodsInfoAndAttrValueDto, String doType, SalePartner salePartner) {

        HashMap<String, Object> params = new HashMap<>();
        params.put("appid", salePartner.getOther());
        params.put("act", doType);
        HashMap<String, Object> params2 = new HashMap<>();
        ArtRec artRecreq = new ArtRec();
        artRecreq.setConfig(salePartner.getId());
        artRecreq.setAccountId(goodsInfoAndAttrValueDto.getId());
        List<ArtRec> artRecs = artRecMapper.selectArtRecList(artRecreq);
        params2.put("id", CollectionUtils.isNotEmpty(artRecs) ? artRecs.get(0).getOutid() : goodsInfoAndAttrValueDto.getId());

        params2.put("price", goodsInfoAndAttrValueDto.getPrice());

        GoodsInfoImg goodsInfoImg = new GoodsInfoImg();
        goodsInfoImg.setGoodsId(goodsInfoAndAttrValueDto.getId());
        goodsInfoImg.setType(Constants.STR_1);
        List<GoodsInfoImg> infoImgs = goodsInfoImgMapper.selectGoodsInfoImgList(goodsInfoImg);
        //图片
        String imgUrls = infoImgs.stream().map(info -> info.getImgUrl()).collect(Collectors.toList()).stream().collect(Collectors.joining(","));
        if (StringUtils.isEmpty(imgUrls)) {
            params2.put("pic", goodsInfoAndAttrValueDto.getTitleImg());
        } else {
            params2.put("pic", imgUrls);
        }

        //自动匹配属性
        String substring = salePartner.getSaleName().substring(salePartner.getSaleName().indexOf("_")+1);
        InterAttr interAttr = interAttrMapper.selectInterAttrByConfig(substring, goodsInfoAndAttrValueDto.getGameId());
        params2.put("game", interAttr.getInterGameId());
        //开始匹配区服
        builderServer(goodsInfoAndAttrValueDto, params2, interAttr.getServer());
        //开始匹配多选属性
        String pf_ids = "";
        pf_ids = builderCheckAttr(goodsInfoAndAttrValueDto, interAttr.getCheckAttr(), pf_ids);
        String title = goodsInfoAndAttrValueDto.getDes().replace("+", "加");
        if (title.length() > 2900) {
            title = title.substring(0, 2900);
        }
        params2.put("title", title);
        if (StringUtils.equals("王者荣耀", goodsInfoAndAttrValueDto.getGameName())) {
            params2 = wzryInfo(goodsInfoAndAttrValueDto, params2);
        } else if (StringUtils.equals("和平精英", goodsInfoAndAttrValueDto.getGameName())) {
            params2 = hpjyInfo(goodsInfoAndAttrValueDto, params2);
        } else if (StringUtils.equals("英雄联盟", goodsInfoAndAttrValueDto.getGameName())) {
            params2 = yxlmInfo(goodsInfoAndAttrValueDto, params2);
        } else if (StringUtils.equals("穿越火线", goodsInfoAndAttrValueDto.getGameName())) {
            params2 = cyhxInfo(goodsInfoAndAttrValueDto, params2);
        } else if (StringUtils.equals("枪战王者", goodsInfoAndAttrValueDto.getGameName())) {
            params2 = qzwzInfo(goodsInfoAndAttrValueDto, params2);
        } else if (StringUtils.equals("原神", goodsInfoAndAttrValueDto.getGameName())) {
            params2 = ysInfo(goodsInfoAndAttrValueDto, params2);
        } else if (StringUtils.equals("火影忍者", goodsInfoAndAttrValueDto.getGameName())) {
            params2 = hyrzInfo(goodsInfoAndAttrValueDto, params2);
        } else if (StringUtils.equals("地下城与勇士", goodsInfoAndAttrValueDto.getGameName())) {
            params2 = dnfInfo(goodsInfoAndAttrValueDto, params2);
        } else if (StringUtils.equals("使命召唤", goodsInfoAndAttrValueDto.getGameName())  || StringUtils.equals("使命召唤手游", goodsInfoAndAttrValueDto.getGameName())) {
            params2 = smzhInfo(goodsInfoAndAttrValueDto, params2);
        } else if (StringUtils.equals("英雄联盟(手游)", goodsInfoAndAttrValueDto.getGameName())) {
            params2 = yxlmsyInfo(goodsInfoAndAttrValueDto, params2);
        } else if (StringUtils.equals("永劫无间", goodsInfoAndAttrValueDto.getGameName())) {
            params2 = yjwjInfo(goodsInfoAndAttrValueDto, params2);
        } else if (StringUtils.equals("永劫无间手游", goodsInfoAndAttrValueDto.getGameName())) {
            params2 = yjwjsyInfo(goodsInfoAndAttrValueDto, params2,pf_ids);
        }else if (StringUtils.equals("无畏契约", goodsInfoAndAttrValueDto.getGameName())) {
            params2 = wwqyInfo(goodsInfoAndAttrValueDto, params2);
        }
        else if (StringUtils.equals("金铲铲之战", goodsInfoAndAttrValueDto.getGameName())) {
            params2 = jcczzInfo(goodsInfoAndAttrValueDto, params2);
        }
        else if (StringUtils.equals("三角洲行动", goodsInfoAndAttrValueDto.getGameName())) {
            params2 = sjzxdInfo(goodsInfoAndAttrValueDto, params2);
        }
        else if (StringUtils.equals("暗区突围", goodsInfoAndAttrValueDto.getGameName())) {
            params2 = aqtwInfo(goodsInfoAndAttrValueDto, params2);
        }
        if (StringUtils.isNotEmpty(pf_ids)) {
            params2.put("role", pf_ids.substring(1));
        }
        params2.put("bface", 0);
        params.put("product", params2);
        return params;
    }

    private String builderCheckAttr(GoodsInfoAndAttrValueDto goodsInfoAndAttrValueDto, String checkAttr,String pf_ids) {
        /**
         * 1、先查询自定义中所有多选的字段
         * 2、再查该账号单选字段中的选项
         * 3、再去接口属性匹配表过滤
         */
        Field[] declaredFields = goodsInfoAndAttrValueDto.getClass().getDeclaredFields();
        JSONObject checkAttrJson = JSONObject.parseObject(checkAttr);
        String interCheckBoxReqs = checkAttrJson.getString("interCheckBoxReqs");
        List<JSONObject> checkJsonList = JSONObject.parseArray(interCheckBoxReqs, JSONObject.class);
        if (org.springframework.util.CollectionUtils.isEmpty(checkAttrJson)) {
            throw new GlobalException("接口多选属性暂未配置");
        }

        GameAttrTemplate gameAttrTemplate = new GameAttrTemplate();
        gameAttrTemplate.setGameId(goodsInfoAndAttrValueDto.getGameId());
        gameAttrTemplate.setIsEnable("0");
        List<String> types = new ArrayList<>();
        types.add("checkbox");
        types.add("boxradio");
        gameAttrTemplate.setFieldTypes(types);
        List<GameAttrTemplate> checkAttrTemplates = gameAttrTemplateMapper.selectGameAttrTemplateList(gameAttrTemplate);
        for (JSONObject object : checkJsonList) {
            for (GameAttrTemplate attrTemplate : checkAttrTemplates) {

                String aavName = attrTemplate.getAavName();
                for (Field declaredField : declaredFields) {
                    String name = declaredField.getName();
                    if (aavName.equals(name)) {
                        declaredField.setAccessible(true);

//                        List<String> list2 = new ArrayList<>();
//                        for (String s : split2) {
//                            s = s.replace(" ", "");
//                            list2.add(s);
//                        }
                        Object o = null;
                        try {
                            o = declaredField.get(goodsInfoAndAttrValueDto);
                        } catch (IllegalAccessException e) {
                            throw new GlobalException("多选项" + attrTemplate.getFieldName() + "匹配错误");
                        }
                        String oneValue = String.valueOf(o);
                        if(StringUtils.isNotEmpty(oneValue)) {

                            String interCheckBoxReqsStr = object.getString("interCheckBoxReqs");
                            //开始匹配二级属性
                            List<JSONObject> jsonObjects2 = JSONObject.parseArray(interCheckBoxReqsStr, JSONObject.class);
                            /**
                             * 咱们的f字段  多选项都是用空格 隔开，用,号切割数组，跟匹配的数据匹配、匹配上说明此账号勾选的有此属性
                             */
                            for (JSONObject jsonObject1 : jsonObjects2) {
                                String[] split1 = oneValue.split(",");
                                String ydConfigId1 = jsonObject1.getString("YdConfigId");
                                for (String s : split1) {
                                    if (Objects.equals(s, ydConfigId1)) {
                                        String InterConfigId2 = jsonObject1.getString("InterConfigId");
                                        pf_ids += "," + InterConfigId2;
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        return pf_ids;
    }

    /**
     * 开始匹配区服属性
     *
     * @param goodsInfoAndAttrValueDto
     * @param params
     * @param server
     */
    private void builderServer(GoodsInfoAndAttrValueDto goodsInfoAndAttrValueDto, Map params, String server) {
        //========================开始匹配区服属性=====================//
        JSONObject jsonObject = JSONObject.parseObject(server);
        //开始匹配一级区服
        String interServeReqs = jsonObject.getString("interServeReqs");
        String qufuid = "";
        JSONObject oneServerJson = new JSONObject();
        List<JSONObject> oneServer = JSONObject.parseArray(interServeReqs, JSONObject.class);
        if (Objects.equals(goodsInfoAndAttrValueDto.getGameType(), "0")) {
            qufuid = goodsInfoAndAttrValueDto.getSystemId() + "" + goodsInfoAndAttrValueDto.getCarrierId() + "";
            for (JSONObject object : oneServer) {
                String ydServeId = object.getString("YdServeId");
                if (StringUtils.isNotEmpty(ydServeId)) {
                    ydServeId = ydServeId.replace(",", "").replace(" ", "");
                    if (qufuid.contains(ydServeId)) {
                        params.put("area", object.getString("id"));
                        break;
                    }
                }
            }
        } else {
            qufuid = goodsInfoAndAttrValueDto.getServerId() + "";
            for (JSONObject object : oneServer) {
                String interServeReqs1 = object.getString("interServerRes");
                if(StringUtils.isNotEmpty(interServeReqs1)) {
                    List<JSONObject> oneServers = JSONObject.parseArray(interServeReqs1, JSONObject.class);
                    for (JSONObject jsonObject1 : oneServers) {
                        String ydServeId = jsonObject1.getString("YdServeId");
                        if(StringUtils.isNotEmpty(ydServeId)) {
                            ydServeId = ydServeId.replace(",", "").replace(" ", "");
                            if (qufuid.contains(ydServeId)) {
                                params.put("area", object.getString("id"));
                                params.put("server", jsonObject1.getString("id"));
                                break;
                            }
                        }
                    }
                }
            }
        }
    }

    public static void main(String[] args) {

//        qufu(2720);
//        shuxing(2005, 0);

        String shuxing = shuxing(2720,8592);
        log.info(shuxing);
    }

    static void qufu(int id) {

        HashMap<String, Object> hashMap = getFZ(id);
        log.info("换号吧新增请求参数={}", hashMap);
        String response = HttpUtils.doPostForm(OutUrlConstant.HHBURL + "/api/open/get-area", hashMap, null);
        log.info(response);
    }

    static String shuxing(int gameId, int id) {
        HashMap<String, Object> hashMap = getFZSX(gameId, id);
        String response = HttpUtils.doPostForm(OutUrlConstant.HHBURL + "/api/open/get-game", hashMap, null);
        return response;
    }

    static HashMap getFZ(int id) {
        HashMap<String, Object> hashMap = new HashMap<>();
        String key = "czs278634e081528d0c0e412ceed898a";
        String appid = "393";
        Map<String, Object> hhbDto = new HashMap<>();
        hhbDto.put("parentId", id);
        hhbDto.put("appid", appid);
        String json = JSONObject.toJSONString(hhbDto);
        hashMap.put("data", json);
        hashMap.put("sign", DigestUtils.md5Hex(json + key));
        return hashMap;
    }

    static HashMap getFZSX(int gameId, int id) {
        HashMap<String, Object> hashMap = new HashMap<>();
        String key = "p9s1584689af90d15b61f25060d11cb9";
        String appid = "494";
        Map<String, Object> hhbDto = new HashMap<>();
        hhbDto.put("gameId", gameId);
        hhbDto.put("parentId", id);
        hhbDto.put("appid", appid);
        String json = JSONObject.toJSONString(hhbDto);
        hashMap.put("data", json);
        hashMap.put("sign", DigestUtils.md5Hex(json + key));
        return hashMap;
    }

    HashMap wzryInfo(GoodsInfoAndAttrValueDto goodsInfoAndAttrValueDto, HashMap<String, Object> params2) {
        if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF7())) {
            params2.put("param1", Integer.parseInt(goodsInfoAndAttrValueDto.getF7()));
        }
        if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF8())) {
            params2.put("param2", Integer.parseInt(goodsInfoAndAttrValueDto.getF8()));
        }
        if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF13())) {
            params2.put("param3", Integer.parseInt(goodsInfoAndAttrValueDto.getF13()));
        }
        String guizuFN = reRedioValue(goodsInfoAndAttrValueDto.getF2());
        if (StringUtils.isNotEmpty(guizuFN)) {
            int gzdj = Integer.parseInt(getNum(guizuFN));
            params2.put("param4", gzdj);
        }
        String smFN = reRedioValue(goodsInfoAndAttrValueDto.getF16());
        if (StringUtils.equals(smFN, "可二次实名") || StringUtils.equals(smFN, "已删实名")) {
            params2.put("canreal", 1);
            params2.put("bface", 0);
        } else if (StringUtils.equals(smFN, "包人脸")) {
            params2.put("canreal", 2);
            params2.put("bface", 1);
        } else {
            params2.put("canreal", 2);
            params2.put("bface", 0);
        }
        return params2;
    }

    HashMap hpjyInfo(GoodsInfoAndAttrValueDto goodsInfoAndAttrValueDto, HashMap<String, Object> params2) {
        params2.put("game", 207);
        switch (goodsInfoAndAttrValueDto.getSystemName() + goodsInfoAndAttrValueDto.getCarrierName()) {
            case "安卓QQ":
                params2.put("area", 1950);
                break;
            case "安卓微信":
                params2.put("area", 1917);
                break;
            case "苹果QQ":
                params2.put("area", 1951);
                break;
            case "苹果微信":
                params2.put("area", 1918);
                break;
        }
        String smFN = reRedioValue(goodsInfoAndAttrValueDto.getF10());
        if (StringUtils.equals(smFN, "可二次实名") || StringUtils.equals(smFN, "已删实名")) {
            params2.put("canreal", 1);
            params2.put("bface", 0);
        } else if (StringUtils.equals(smFN, "包人脸")) {
            params2.put("canreal", 2);
            params2.put("bface", 1);
        } else {
            params2.put("canreal", 2);
            params2.put("bface", 0);
        }
        String des = goodsInfoAndAttrValueDto.getDes().length()>2900?goodsInfoAndAttrValueDto.getDes().substring(0,2900):goodsInfoAndAttrValueDto.getDes();
        params2.put("title", des.replace("+", "加"));
        if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF8())) {
            params2.put("param1", Integer.parseInt(goodsInfoAndAttrValueDto.getF8()));
        }
        if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF9())) {
            params2.put("param2", Integer.parseInt(goodsInfoAndAttrValueDto.getF9()));
        }
        if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF7())) {
            params2.put("param3", Integer.parseInt(goodsInfoAndAttrValueDto.getF7()));
        }
        String roleIds = "";
        String rmzj = "玛莎拉蒂蓝色=441,玛莎拉蒂粉色=442,玛莎拉蒂金色=443,南瓜车=444,双人摩托梦幻火箭=445,特斯拉3银色=522,特斯拉X白色=523,阿斯顿马丁S绿色=588," +
                "阿斯顿马丁S金色=589,阿斯顿马丁X橙色=590,阿斯顿马丁X金色=591,合金龙骨绿色=592,合金龙骨红色=593,特斯拉3白色=924,特斯拉3紫色=925,特斯拉X银色=926," +
                "特斯拉X紫色=927,阿斯顿马丁S红色=928,阿斯顿马丁X蓝色=929,空客蔚蓝之翼=931,空客恋语之翼=932,合金龙骨蓝色=933,兰博SVJ金色=1773,兰博SVJ尊享铂=1774," +
                "兰博SVJ绿色=1775,兰博SUV金色=1776,兰博SUV尊享铂=1777,兰博SUV黄色=1778,兰博轿车金色=1779,兰博轿车灰色=1780,萌兔起飞=1837,焰龙咆哮=1838," +
                "海龙奔腾=1839,金龙耀世=1840,萌喵橘座=1841,灵鼠银迹=1842,鬼马风驰=1843,塞莎KL27鲸之蓝=1844,塞莎霓虹粉=1845,塞莎深潜蓝=1846,特斯拉R水滴蓝=1847," +
                "特斯拉R沁心粉=1848,特斯拉R尊享铂=1849,特斯拉C极昼黑=1850,特斯拉C荒芜蓝=1851,特斯拉C镭光铂=1852,双刃魅影金色=1853,双刃魅影绿色=1854," +
                "双刃魅影红色=1855,兰博轿车尊享铂=2384,路特斯EL紫色=2385,路特斯EL蓝色=2386,路特斯EL灰色=2387,极速兔兔车=2388";
        Map rmzjMap = stringTOmap(rmzj);
        if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF2())) {
            List<GameAttribute> gameAttributes = getGameAttributs(goodsInfoAndAttrValueDto.getF2());
            if (CollectionUtils.isNotEmpty(gameAttributes)) {
                for (GameAttribute gameAttribute : gameAttributes) {
                    String rmzjName = gameAttribute.getFieldName();
                    if (StringUtils.equals(rmzjName, "塞莎鲸之蓝")) {
                        rmzjName = "塞莎KL27鲸之蓝";
                    }
                    if (Objects.nonNull(rmzjMap.get(rmzjName))) {
                        roleIds = roleIds + "," + rmzjMap.get(rmzjName);
                    }
                }
            }
        }
        String rmfxq = "荧光虫舞飞行器=1924,春暖花开飞行器=1925,夜王飞行器=1926,精灵迷巫飞行器=1927,霓虹街区飞行器=1928,梦幻火箭飞行器=1929,至尊龙雀飞行服=1930," +
                "星之彼岸飞行器=2574,星之信仰飞行翼=2575,枪炮玫瑰飞行器=2576,暗翼战神飞行器=2577,齐天大圣飞行器=2578,阿狸红飞行器=2579,甜蜜誓约飞行器=2580," +
                "童趣迷兔飞行器=2581,激战未来飞行器=2582,扶摇飞仙飞行器=2583,繁花小夜曲飞行翼=2584,四圣焕新飞行器=2585,心之恋语飞行器=2586,马卡龙飞行器=2587," +
                "焰龙焚天飞行器=2588,梦之光华飞行器=2589,相思残雪飞行器=2590,深海曼妙飞行器=2591,炫紫旋律飞行器=2592,伏魔团飞行器=2593,锦绣火鲤飞行器=2594," +
                "潮汐统领飞行器=2595,王牌四分卫飞行器=2596,诡面斩飞行器=2597,林间仙鹿飞行器=2598,风花雪月飞行器=2599,花间之火飞行器=2600,红伞翩翩飞行器=2601," +
                "机甲封神飞行器=2602,神秘黑猫飞行器=2603,终极赛罗飞行器=2604,绮梦青鸾飞行器=2605,古堡领主飞行器=2606,夏日绵绵冰飞行器=2607,古战神甲飞行器=2608";

        Map rmfxqMap = stringTOmap(rmfxq);
        if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF3())) {
            List<GameAttribute> gameAttributes = getGameAttributs(goodsInfoAndAttrValueDto.getF3());
            if (CollectionUtils.isNotEmpty(gameAttributes)) {
                for (GameAttribute gameAttribute : gameAttributes) {
                    String rmfxqName = gameAttribute.getFieldName();
                    if (Objects.nonNull(rmfxqMap.get(rmfxqName))) {
                        roleIds = roleIds + "," + rmfxqMap.get(rmfxqName);
                    }
                }
            }
        }
//        String rmjls = "快乐主宰=1932,雪国幻梦=1933,至尊龙雀=1934,金凤玉露=1935,星之信仰=1936,潮汐统领=1937,愤怒胖红=1938,浪漫波比=1939,勇者同行=1940," +
//                "幻影战神=1941,银河战甲=1942,甜心宝贝=1943,凝视深渊=1944,古堡领主=1945,精灵迷巫=1946,华贵君王=1947,春暖花开=1948,梦幻火箭=1949,甜蜜誓约=1950," +
//                "龙虾霸霸=1951,神秘黑猫=1952,轰鸣竞梦者=1953,深海曼妙=1954,炫紫旋律=1955,扶摇飞仙=1956,花间之火=1957,心之恋语=1958,繁花小夜曲=1959," +
//                "童趣迷兔=1960,银刃赛罗=1961,四圣焕新=1962,阿狸红=1963,锦绣火鲤=1964,香水柠檬=1965,葫芦兄弟=1966,怪笑疯兔=1967,古战神甲=1968,烈焰拳霸=1969," +
//                "蓝海之火=1970,化学天才=1971,铁甲雄心=1972,元宵华灯=1973,勇闯险境=1974,丛林猎人=1975,草莓天空=1976,特工巴纳纳=1977,诡娃娃=1978,冰封烈焰=1979," +
//                "时之沙漏=1980,醒狮欢腾=1981,暗夜武装=1982,放飞梦想=1983,黑色刀锋=1984,九霄=1985,霓虹街区=1986,PEC最牛战神=1987,潮萌小黄鸭=1988," +
//                "众神之王=1989,不夜海上花=1990,乘风破浪=1991,山经魅狐=1992,机械英豪=1993,跑卡漂移=1994,牛气冲天=1995,原初圣火=1996,沙场雄鹰=1997," +
//                "镭射皇者=1998,治愈之星=1999,炫光贝贝=2000,青春冒险家=2001,时空追击者=2002,萌趣颜团子=2003,光子定制=2004,寂夜之火=2005,迎春赐福=2006," +
//                "浪客战士=2007,红色闪电=2008,粉色滑翔尾迹=2009,烟花=2010,PEC=2011,PEL最牛战神=2012,S王牌=2013,SS王牌=2014,仓鼠灰灰=2015,伏魔团=2016," +
//                "光影工厂=2017,冥河战士=2018,动感兔斯基=2019,南瓜骑士=2020,吾皇万睡=2021,和平使命=2022,和平先锋=2023,四圣换新=2024,国宝胖达=2025," +
//                "圣诞大吉=2026,夏日倾情=2027,夏日绵绵冰=2028,夏日音浪=2029,天启纪元=2030,天涯共此时=2031,天纪突击=2032,奇异狩猎者=2033,寂静之火=2034," +
//                "寒蝎幽灵=2035,小丑=2036,彩虹勇气=2037,怪兽之王=2038,折纸暴龙=2039,拳皇=2040,时空追击=2041,星之彼岸=2042,星际漫游者=2043,暗翼战神=2044," +
//                "未来战士=2045,机甲封神=2046,极限特训=2047,枪炮玫瑰=2048,梦之光华=2049,梦颜趣团子=2050,橙云=2051,沙漠守护者=2052,海域冒险=2053,滑板小狐=2054," +
//                "潮黄小黄鸭=2055,灵绣=2056,特殊使命=2057,狂战都市=2058,狮王雄心=2059,王牌四分卫=2060,白昼之火=2061,百万伏特=2062,相思残雪=2063,破晓战魂=2064," +
//                "神秘科技=2065,童话森林=2066,粉色回忆=2067,绚烂橙彩=2068,绮梦青鸾=2069,绯红秘境=2070,罗小黑=2071,荒野猎神=2072,荧光虫舞=2073,萌熊伴侣=2074," +
//                "萌神柯基=2075,蜘蛛突变者=2076,西部牛仔=2077,诡面斩=2078,赤蝎幽灵=2079,踏青=2080,都市猎人=2081,酷熊伴侣=2082,金羽特工=2083,金风玉露=2084," +
//                "金鼠迎春=2085,钢铁雄心=2086,阳光火鸡=2087,雷霆特警=2088,飞行日记=2089,马卡龙=2090,马戏团糖果=2091";
//        Map rmjlsMap = stringTOmap(rmjls);
//        if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF4())) {
//            List<GameAttribute> gameAttributes = getGameAttributs(goodsInfoAndAttrValueDto.getF4());
//            if (CollectionUtils.isNotEmpty(gameAttributes)) {
//                for (GameAttribute gameAttribute : gameAttributes) {
//                    String rmjlsName = gameAttribute.getFieldName();
//                    rmjlsName = rmjlsName.replace("降落伞", "");
//                    if (Objects.nonNull(rmjlsMap.get(rmjlsName))) {
//                        roleIds = roleIds + "," + rmjlsMap.get(rmjlsName);
//                    }
//                }
//            }
//        }

        String rmqx = "M416五爪金龙=471,SCARL梦幻火箭=472,AKM甜心宝贝=473,UMP4雪国精灵=476,M416火箭少女101=477,AKM炫紫旋律=530,M24星之信仰=543," +
                "Mini14龙虾霸霸=544,M416心之恋语=594,M762甜蜜誓言=595,98K伏魔团=596,爆炸猎弓=1807,M417射手步枪=1808,M416南瓜骑士=1809," +
                "AKM影袭=1810,SCARL银河战甲=1811,SCARL致命红樱=1812,SCARL梦幻火箭=1813,SCARL扶摇飞仙=1814,AUG幻影战神=1815,AUG甜蜜菠萝=1816," +
                "AUG魅夜紫皇=1817,M762魅夜紫皇=1818,G36C花间之火=1819,M762甜蜜誓约=1820,Kar98K幻影战神=1821,Kar98K魅夜紫皇=1822," +
                "Kar98K绿意幻情=1823,AWM花间之火=1824,SKS心之恋语=1825,SKS金玉无双=1826,Mini龙虾霸霸=1827,UZI幻影战神=1828,UZI金玉无双=1829," +
                "UZI影袭=1830,UMP5电音之王=1831,UMP5火箭少女=1832,UMP5雪国精灵=1833,Vector魅影紫皇=1834,汤姆逊花火之间=1835,DP28扶摇飞仙=1836," +
                "M16A4葫芦兄弟=2508,M24暗星紫秘=2509,M249古战神甲=2510,M249蓝莓炮弹=2511,UZI绮梦青鸾=2512,M416风花雪月=2513,平底锅林间仙鹿=2514," +
                "AKM梦之光华=2515,M762甜心娃娃=2516,M762激战未来=2517,GROZA香水柠檬=2518,GROZA焦糖拿铁=2519,DP28枪炮玫瑰=2520,汤姆逊怪笑疯兔=2521," +
                "Vector红伞翩翩=2522,SCAR童趣迷兔=2523,SCAR机甲封神=2524,SCARL青春物语=2525,SCAR梦幻火箭=2526,AUG星之彼岸=2527,AWM橘柚倾心=2528," +
                "AWM焰龙焚天=2529,UMP45雪国精灵=2530,UMP45相思残雪=2531,UMP45恐龙拽拽=2532,SKS诡面斩=2533,SKS碧影闪光=2534,SLR暗夜玫瑰=2535," +
                "MG3洛神天依=2536,Mini14荧光虫舞=2537,Mini14绚金瑰梦=2538,VSS烈焰拳霸=2539,S12K海渊国主=2540,98K暗翼战神=2541,野牛流星咚咚=2542," +
                "M24奇异狩猎者=2543,M249古堡领主=2544,M24香水柠檬=2545,M24激战未来=2546,M416魔法学院=2547,M416仓鼠灰灰=2548,M416快乐主宰=2549," +
                "M416梨园星光=2550,M762奇异狩猎者=2551,M762潮萌小黄鸭=2552,M762瑞龙福将=2553,M762风花雪月=2554,MK47林间仙鹿=2555,98K终极赛罗=2556," +
                "98K深海曼妙=2557,98K古堡领主=2558,98KPEC最牛战神=2559,AKM奇异狩猎者=2560,AKM山经魅狐=2561,AWM激战未来=2562,Mini14林间仙鹿=2563," +
                "S686奇异狩猎者=2564,Vector风花雪月=2565,GROZA林间仙鹿=2566,汤姆逊林间仙鹿=2567,SCAR粉色回忆=2568,AWM黄金龙骨=2569,M416黄金龙骨=2570," +
                "M416星际漫游=2571,AKM缤纷海域=2572,AKM百万伏特=2573";
        Map rmqxMap = stringTOmap(rmqx);
        if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF1())) {
            List<GameAttribute> gameAttributes = getGameAttributs(goodsInfoAndAttrValueDto.getF1());
            if (CollectionUtils.isNotEmpty(gameAttributes)) {
                for (GameAttribute gameAttribute : gameAttributes) {
                    String rmqxName = gameAttribute.getFieldName();
                    rmqxName = rmqxName.replaceAll("-", "");
                    if (Objects.nonNull(rmqxMap.get(rmqxName))) {
                        roleIds = roleIds + "," + rmqxMap.get(rmqxName);
                    }
                }
            }
        }
        String rmtz = "蝶舞迷情=446,梦幻火箭=447,雪国梦幻=448,守护骑士=449,精灵迷巫=450,金耀白虎=451,木耀青龙=452,水耀玄武=453,火耀朱雀=454,土耀战麟=455," +
                "深渊皇后=456,宝贝奶油派=457,天使彩虹糖=458,甜心巧克力=459,快乐主宰=460,幻影战神=461,南瓜骑士=462,数码大师=463,星际漫游者=464,极限特训=465," +
                "怪诞乔克=466,银河战甲=467,荒野猎神=468,折纸暴龙=469,深海小丑鱼=470,奇异狩猎者=531,星之信仰=532,华贵君王=533,天启纪元=534,麻辣鲜香锅=535," +
                "金风玉露=536,金属狂野=537,静灵氛围=538,智能音符=539,缤纷油彩=540,放客神游=541,深海曼妙=542,浪漫波比=545,黄金大亨=546,PEL轰鸣竞梦者=597," +
                "古堡领主=598,天禅智恒=599,慧云及圣=600,狩月元帅=601,琉璃脉冲=602,新星烈龙=603,向日葵=604,甜蜜誓约=605,心之恋语=606,极致幻想=607,星空之魅=608," +
                "至尊金龙=1781,黑耀金尊=1782,专家巡查员=1783,翡翠骑士=1784,银刃赛罗=1785,赛罗闪耀型=1856,虎啸骄阳=1857,炙焰赤龙=1858,飓风飞鹰=1859," +
                "烈焰拳霸=1860,星之彼岸=1861,绮梦青鸾=1862,童趣迷兔=1863,冰霜白皇=1864,炙焰红王=1865,苍蓝魅影=1866,绚金战神=1867,香水柠檬=1868,铁甲悍将=1869," +
                "黄蜂伯爵=1870,鳞翅贤者=1871,迷蝶贵族=1872,星点战士=1873,锦绣火鲤=1874,花间之火=1875,扶摇飞仙=1876,向日癸=1877,金凤玉露=1878,精灵女巫=1879," +
                "火曜朱雀=1880,水曜玄武=1881,土曜战麒=1882,木曜青龙=1883,金曜白虎=1884,骄骑迪迦=1885,诡谋托雷基亚=1886,迅捷之星=1887,闪金天王=1888," +
                "粉甜马卡龙=1889,动感兔斯基人偶服=1890,激萌罗小黑=1891,神秘黑猫=1892,爱神=1893,摇滚狂鲨=1894,云丝凤蟒=1895,新侠客行=1896,软嫩糖心蛋=1897," +
                "九霄=1898,激萌小黄鸭=1899,暗夜武装=1900,裁决冥王=1901,云虎纪=1902,胖达团团=1903,冰焰天使=1904,雪山精英=1905,忍者信条=1906,幻影公爵=1907," +
                "街舞达人=1908,街舞之王=1909,缤纷假日=1910,浪漫假日=1911,狂战萌兔=1912,蜜桃特工=1913,蝶舞蔷薇=1914,葫芦兄弟=1915,吉利礼服=1916,蝎王蛇后=1917," +
                "鹤发童颜=1918,迪迦奥特曼=1919,幻情紫藤=1920,青葱仙萝=1921,金风银杏=1922,甜梦冰蝶=2389,粉色回忆=2390,彗云及圣=2391,馨动时刻=2392," +
                "甜心娃娃=2393,相思残雪=2394,王牌四分卫=2395,林间仙鹿=2396,海盐物语=2397,绚金瑰梦=2398,彩虹鹿灵=2399,闪耀迪迦=2400,百合蜜语=2401," +
                "幻彩马卡龙=2402,恐龙拽拽=2403,蓝莓炮弹=2404,枪炮玫瑰=2405,暗翼战神=2406,天之羽翼=2407,岚岚物语=2408,桀骜红莲=2409,紫鸢之舞=2410," +
                "赤焰黑爵=2411,山涧鹿灵=2412,星云玉兔=2413,红螳螂=2414,薄荷物语=2415,洛天依=2416,冷魅冰骑=2417,暗星紫秘=2418,紫电风暴=2419,焰龙焚天=2420," +
                "暗夜玫瑰=2421,庄周梦蝶=2422,银龙傲海=2423,未来战士=2424,精灵娃娃=2425,草莓生巧=2426,黄螳螂=2427,焦糖拿铁=2428,黑伞漫漫=2429,海渊国主=2430," +
                "铁血龙王=2431,绿野柔风=2432,碧影闪光=2433,显圣真君=2434,潮汐统领=2435,诡面斩=2436,酣梦娃娃=2437,红伞翩翩=2438,俏皮狐尾=2439,独舞天鹅=2440," +
                "吟月归客=2441,黄伞悠悠=2442,齐天大圣=2443,沙场疾风=2444,骨龙祭渊=2450,紫螳螂=2452,花影阑珊=2453,俏雪含霜=2454,流星咚咚=2455,灵绣=2460," +
                "特工巴纳纳=2461,裁决冥王=2462,醒狮腾龙=2463,恶魔人蛛=2464,东方飞龙=2465,童话森林=2466,罗小黑=2467,豚鼠丹丹=2468,漫步者=2469,怪兽之王=2470," +
                "狂沙舞者=2471,大橘为重=2472,梦起落英=2473,金羽特工=2474,纯白誓言=2475,仓鼠灰灰=2476,怪笑疯兔=2477,诡面顽熊=2478,都市猎人=2479," +
                "AUG-魔法学院=2480,AUG-PEC最牛战神=2481,暗影哥特=2482,胖达圆圆=2483,萌神柯基=2484,迅捷狂鲨=2485,滑板小狐=2486,幽冥伯爵=2487," +
                "梨园星光=2488,水银刺客=2489,潮萌小黄鸭=2490,狮王雄心=2491,西部牛仔=2492,SS1特训=2493,酷熊伴侣=2494,暗夜之虎=2495,暗夜契约=2496," +
                "团圆交子=2497,萌熊伴侣=2498,炫光贝贝=2499,浪客战士=2500,山经魅狐=2501,瑞龙福将=2502,派对舞王=2503,星河浪客=2504,木乃伊=2505," +
                "火箭少女101=2506,巡查衣=2507";

        Map rmtzMap = stringTOmap(rmtz);
        if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF5())) {
            List<GameAttribute> gameAttributes = getGameAttributs(goodsInfoAndAttrValueDto.getF5());
            if (CollectionUtils.isNotEmpty(gameAttributes)) {
                for (GameAttribute gameAttribute : gameAttributes) {
                    String rmtzName = gameAttribute.getFieldName();
                    if (StringUtils.equals(rmtzName, "暗影哥特(红眼罩)")) {
                        rmtzName = "暗影哥特";
                    } else if (StringUtils.equals(rmtzName, "雪山精英(老6服)")) {
                        rmtzName = "雪山精英";
                    }
                    if (Objects.nonNull(rmtzMap.get(rmtzName))) {
                        roleIds = roleIds + "," + rmtzMap.get(rmtzName);
                    }
                }
            }
        }

        if (StringUtils.isNotEmpty(roleIds)) {
            params2.put("role", roleIds.replaceFirst(",", ""));
        }

        return params2;
    }

    HashMap yxlmInfo(GoodsInfoAndAttrValueDto goodsInfoAndAttrValueDto, HashMap<String, Object> params2) {
        if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF3())) {
            params2.put("param1", Integer.parseInt(goodsInfoAndAttrValueDto.getF3()));
        }
        if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF4())) {
            params2.put("param2", Integer.parseInt(goodsInfoAndAttrValueDto.getF4()));
        }
        params2.put("bface", 0);
        String smFN = reRedioValue(goodsInfoAndAttrValueDto.getF1());
        if (StringUtils.contains(smFN, "有二次")) {
            params2.put("canreal", 1);
        }else if(StringUtils.equals(smFN, "包人脸")){
            params2.put("canreal", 2);
        } else {
            params2.put("canreal", 2);
        }
        return params2;
    }

    HashMap cyhxInfo(GoodsInfoAndAttrValueDto goodsInfoAndAttrValueDto, HashMap<String, Object> params2) {
        params2.put("game", 206);
        String daqu = "山东=1833--1835,河北=1834--1835,辽宁=1836--1835,河南=1837--1835,北方大区=1839--1835,吉林=1840--1835," +
                "山西=1841--1835,黑龙江=1842--1835,北京=1843--1835,四川=1823--2001,重庆=1824--2001,陕西=1825--2001,云南=1826--2001," +
                "上海=1827--2000,江苏=1828--2000,浙江=1829--2000,福建=1830--2000,安徽=1831--2000,教育网专区=2003--2000," +
                "移动专区=2004--2000,广东=1818--2002,广西=1819--2002,湖南=1820--2002,湖北=1821--2002,江西=1822--2002,南方大区=1832--2002";
        Map qdqMap = stringTOmap(daqu);
        String serverName = "";
        if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getServerName())) {
            serverName = goodsInfoAndAttrValueDto.getServerName();
            if (StringUtils.equals(serverName, "黑龙江区")) {
                serverName = "黑龙江";
            }
            serverName = serverName.replace("一区", "")
                    .replace("二区", "")
                    .replace("三区", "")
                    .replace("四区", "");
        }
        if (Objects.nonNull(qdqMap.get(serverName))) {
            String qu = qdqMap.get(serverName).toString();
            params2.put("area", qu.split("--")[1].trim());
            params2.put("server", qu.split("--")[0].trim());
        } else {
            throw new GlobalException(goodsInfoAndAttrValueDto.getId() + "穿越火线区服未找到");
        }

        String smFN = reRedioValue(goodsInfoAndAttrValueDto.getF3());
        if (StringUtils.contains(smFN, "有修改机会") || StringUtils.equals(smFN, "已删实名")) {
            params2.put("canreal", 1);
            params2.put("bface", 0);
        } else {
            params2.put("canreal", 2);
            params2.put("bface", 0);
        }

        String roleIds = "";
        List<GameAttribute> gameAttributesYXK = new ArrayList<>();
        if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF20())) {
            gameAttributesYXK = getGameAttributs(goodsInfoAndAttrValueDto.getF20());
            if (CollectionUtils.isNotEmpty(gameAttributesYXK)) {
                String rmdj = "M4A1-雷神音效卡=1016,AK47-火麒麟音效卡=1017,Barrett-毁灭音效卡=1018,M4A1-黑骑士音效卡=1019," +
                        "Barrett-极光音效卡=1020," +
                        "M4A1-黑龙音效卡=1021";
                Map rmdjMap = stringTOmap(rmdj);
                for (GameAttribute gameAttribute : gameAttributesYXK) {
                    String rmdjName = gameAttribute.getFieldName();
                    if (Objects.nonNull(rmdjMap.get(rmdjName))) {
                        roleIds = roleIds + "," + rmdjMap.get(rmdjName);
                    }
                }
            }
        }

        String pfIds = "";
        pfIds = reIds(pfIds, goodsInfoAndAttrValueDto.getF16());
        pfIds = reIds(pfIds, goodsInfoAndAttrValueDto.getF17());
        pfIds = reIds(pfIds, goodsInfoAndAttrValueDto.getF18());
        if (StringUtils.isNotEmpty(pfIds)) {
            List<GameAttribute> gameAttributes = getGameAttributs(pfIds);
            if (CollectionUtils.isNotEmpty(gameAttributes)) {
                String rmpf = "传奇石头-横秒之巅=3500,莞裳=3501,M4A1-黑龙-361=3502,AK47-黑武士-361=3503,无影耀金皮肤=3504,雷神-耀金皮肤=3505," +
                        "修罗耀金=3506,黑骑士-耀金皮肤=3507,毁灭耀金皮肤=3508,毁灭-星空=3509,雷神-星空=3510,修罗星空=3511,烈龙星空=3512," +
                        "毁灭CF52018=3513," +
                        "幻神青鹤=3514,M200-幻神-丹凤=3515,冠军之魂=3516," +
                        "火麒麟-轻羽皮肤=3517,毁灭-CFS2018=3518,毁灭-CFS2020=3519,毁灭-绿豆=3520,毁灭-AG-CFPLS15冠军=3521,毁灭-战神张飞=3522," +
                        "毁灭虎牙=3523," +
                        "毁灭-枪娘格雷姐妹=3524,荣耀之锋=3525,屠龙-荣耀世冠AG=3526,冠军之啸=3527,冠军之击=3528,擎天虎牙=3529,麒麟刺斗鱼=3530," +
                        "火麒麟-华夏之心=3531," +
                        "荣耀之魄=3532,火麒麟-AG战队皮肤=3533," +
                        "雷神-传奇N9=3534,毁灭-SV16冠军=3535,雷神-虎将=3536,AK47-火麒麟-传奇EVEN=3537,毁灭-荣耀之怒=3538,幻神冠军之幻=3539," +
                        "幻神-宠儿=3540," +
                        "M200-幻神-周瑜=3541,幻神-AG-CFPLS17冠军=3542,M200-幻神-黄忠=3543,雷神-宠儿-2019MVP=3544,M4A1-战神赵云=3545," +
                        "雷神-冠军之魄=3546,M4A1-雷神FCS 2019=3547," +
                        "雷神-斗鱼皮肤=3548,雷神-白沙-CFPLS14冠军=3549,雷神-荣耀世冠AG=3550,雷神杨戬=3551,雷神-R.LGD-CFPLS18冠军=3552," +
                        "火麒麟-战神关羽=3553,火麒麟-冠军之心=3554,传奇石头-横秒之巅=3555,火麒麟CFS2018=3556,火麒麟-盘古=3557,火麒麟白虎=3558," +
                        "火麒麟斗鱼皮肤=3559," +
                        "火麒麟-枪娘凯萨琳=3560,火麒麟-荣耀世冠=3561,黑龙-冠军之武=3562,黑龙-墨子皮肤=3563,黑骑士-战神马超=3564," +
                        "黑骑士-地狱火=3565,黑骑士-冠军之势=3566,黑骑士-伏羲=3567,黑骑士-AG-S4冠军典藏=3568,黑骑士-虎牙皮肤=3569,黑骑士-CFS2021=3570," +
                        "毁灭-冠军之怒=3571";
                Map rmpfMap = stringTOmap(rmpf);
                for (GameAttribute gameAttribute : gameAttributes) {
                    String rmpfName = gameAttribute.getFieldName();
                    if (Objects.nonNull(rmpfMap.get(rmpfName))) {
                        roleIds = roleIds + "," + rmpfMap.get(rmpfName);
                    }
                }
            }
        }
        String wqIds = "";
        wqIds = reIds(wqIds, goodsInfoAndAttrValueDto.getF12());
        wqIds = reIds(wqIds, goodsInfoAndAttrValueDto.getF13());
        if (StringUtils.isNotEmpty(wqIds)) {
            List<GameAttribute> gameAttributes = getGameAttributs(wqIds);
            if (CollectionUtils.isNotEmpty(gameAttributes)) {
                String rmwq = "Kar98k-星神=973,朱雀M4=974,传说光耀=975,王者幻神=976,王者葵貂蝉=977,M4A1-青龙=978,朱雀=979,M200-幻神=980,Scar" +
                        " Light-白虎=981,6盘龙=982,6烈龙=983," +
                        "雷神刀锋=984,AK47-黑鲨=985,AWM-裁决=986,M4A1-龙血=987,7雷霆套=988,7雷暴套=989,6雷霆套=990,6雷暴套=991,5雷霆套=992," +
                        "5雷暴套=993," +
                        "神圣爆裂者=994,7盘龙=995,7烈龙=996,斯泰尔蝴蝶=997";
                Map rmwqMap = stringTOmap(rmwq);
                for (GameAttribute gameAttribute : gameAttributes) {
                    String rmwqName = gameAttribute.getFieldName();
                    if (Objects.nonNull(rmwqMap.get(rmwqName))) {
                        roleIds = roleIds + "," + rmwqMap.get(rmwqName);
                    }
                }
            }
        }
        String wqIds1 = "";
        wqIds1 = reIds(wqIds1, goodsInfoAndAttrValueDto.getF14());
        wqIds1 = reIds(wqIds1, goodsInfoAndAttrValueDto.getF15());
        if (StringUtils.isNotEmpty(wqIds1)) {
            List<GameAttribute> gameAttributes = getGameAttributs(wqIds1);
            if (CollectionUtils.isNotEmpty(gameAttributes)) {
                String xywq = "竞技荣光=3660,盘龙-悦心=3662,炼狱-悦蓝=3664,玫瑰精灵-悦动=3666,超新星-悦享=3668,天启-悦智=3670,炫金火麒麟=3672," +
                        "王者之魄烟雾弹=3674," +
                        "王者之魄闪光弹=3676,王者之魄高爆手雷=3678,王者雷霆套=3680,王者青龙=3682,王者雷怒=3684,王者白虎传说光耀=3686,加特林-惊涛骇浪=3688," +
                        "王者凤吟=3690," +
                        "传说暗裔=3692,王者炎心=3694,传说梦魇=3696,传说圣灵=3698,盘龙悦心=3700,烈龙-悦心=3702,蝴蝶斯太尔+6烈龙=3704,王者火魄=3706," +
                        "王者幻神=3708," +
                        "王者蔷薇=3710,王者之烈=3712,王者冰魄=3714,王者玉峰=3716,王者星神=3718,荣耀世冠套=3720,贵族金-牛牛ak=3722,猫猫-cop=3724," +
                        "黄金猫猫手套=3726," +
                        "黄金猫猫手套-白鲨=3728,加特林-斗鱼平台=3730";
                String wzxjwq = "王者之心=943,王者之魄=944,王者之怒=945,王者之武=946,王者之势=947,王者之力=948,王者之幻=949,王者之影=950,王者之戮=951," +
                        "王者之圣=952," +
                        "王者之翼=953,王者之光=954,王者之魂=955,王者之灵=956,王者之锋=957,王者之啸=958,王者之击=959,王者之刺=960,王者之决=961,王者之鲨=962," +
                        "炫金雷神=963," +
                        "炫金火麒麟=964,炫金毁灭=965,炫金千变=966,炫金黑龙=967,炫金黑骑士=968,炫金无影=969,炫金骑士=970,炫金天龙=971,炫金天神=972";
                Map twoMap = new HashMap();
                twoMap.putAll(stringTOmap(xywq));
                twoMap.putAll(stringTOmap(wzxjwq));
                for (GameAttribute gameAttribute : gameAttributes) {
                    String wqName = gameAttribute.getFieldName();
                    if (Objects.nonNull(twoMap.get(wqName))) {
                        roleIds = roleIds + "," + twoMap.get(wqName);
                    }
                }
            }
        }
        if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF19())) {
            List<GameAttribute> gameAttributes = getGameAttributs(goodsInfoAndAttrValueDto.getF19());
            if (CollectionUtils.isNotEmpty(gameAttributes)) {
                String xyjs = "王者樱-热浪之夏=2914,王者-零-传说之路=2915,王者之瞳=2916,王者王力宏=2917,王者复仇=2918,王者-零=2919,王者救世主=2920," +
                        "王者-沙漠玫瑰=2921," +
                        "电竞教官-云悠悠=2922,零-热舞青春=2923,樱-青春偶像=2924,王者-瞳-闭月羞花=2925,王者-零-国色天香=2926,王者-葵-貂蝉=2927," +
                        "王者-零-华冠丽服=2928,炽天使=2929," +
                        "迷迭香=2930," +
                        "春=2931,蝴蝶=2932,炫=2933,传说女帝=2934,雨棠=2935,影豹=2936,王者-沙漠玫瑰=2937,王者-迷迭香=2938,王者玲珑-小乔=2939," +
                        "凌霄=2940," +
                        "王者涂鸦=2941,王者玲珑=2942,王者-魅影=2943,王者葵-惊若翩鸿=2944,4防王者春=2945,4防凌霄=2946,4防职业经理=2947,职业选手=2948";
                Map xyjsMap = stringTOmap(xyjs);
                for (GameAttribute gameAttribute : gameAttributes) {
                    String xyjsName = gameAttribute.getFieldName();
                    if (Objects.nonNull(xyjsMap.get(xyjsName))) {
                        roleIds = roleIds + "," + xyjsMap.get(xyjsName);
                    }
                }
            }
        }
        if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF4())) {
            String pwzgV = reRedioValue(goodsInfoAndAttrValueDto.getF4());
            String pwzg = "有=409,无=410";
            Map pwzgMap = stringTOmap(pwzg);
            if (Objects.nonNull(pwzgMap.get(pwzgV))) {
                roleIds = roleIds + "," + pwzgMap.get(pwzgV);
            }
        }

        if (CollectionUtils.isNotEmpty(gameAttributesYXK)) {
            String yxk = "Barrett-毁灭音效卡=2901,AK47-火麒麟音效卡=2902,Barrett-极光音效卡=2903,M4A1-黑骑士音效卡=2904,M200-幻神音效卡=2905," +
                    "QBZ音效卡=2906,AWM-裁决音效卡=2907,M4A1-黑龙音效卡=2908," +
                    "M4A1-雷神音效卡=2909,绝迹语音包=2910,白鲨语音包=2911,N9语音包=2912,金色蔷薇音效卡=2913";
            Map yxkMap = stringTOmap(yxk);
            for (GameAttribute gameAttribute : gameAttributesYXK) {
                String yxkName = gameAttribute.getFieldName();
                if (Objects.nonNull(yxkMap.get(yxkName))) {
                    roleIds = roleIds + "," + yxkMap.get(yxkName);
                }
            }
        }
        if (StringUtils.isNotEmpty(roleIds)) {
            params2.put("role", roleIds.replaceFirst(",", ""));
        }
        return params2;
    }

    HashMap qzwzInfo(GoodsInfoAndAttrValueDto goodsInfoAndAttrValueDto, HashMap<String, Object> params2) {
        params2.put("game", 208);
        switch (goodsInfoAndAttrValueDto.getSystemName() + goodsInfoAndAttrValueDto.getCarrierName()) {
            case "安卓QQ":
                params2.put("area", 1923);
                break;
            case "安卓微信":
                params2.put("area", 1965);
                break;
            case "苹果QQ":
                params2.put("area", 1924);
                break;
            case "苹果微信":
                params2.put("area", 1966);
                break;
        }

        String smFN = reRedioValue(goodsInfoAndAttrValueDto.getF10());
        if (StringUtils.contains(smFN, "可修改实名")) {
            params2.put("canreal", 1);
        } else {
            params2.put("canreal", 2);
        }
        params2.put("bface", 0);
        params2.put("title", goodsInfoAndAttrValueDto.getDes().replace("+", "加").replace("\n",""));
        return params2;
    }
    //只保留中文
    private String onlyHanZi(String str) {
        String reg = "[^\u4e00-\u9fa5]";
        str = str.replaceAll(reg, "");
        return str;
    }

    HashMap aqtwInfo(GoodsInfoAndAttrValueDto goodsInfoAndAttrValueDto, HashMap<String, Object> params2) {
        params2.put("area", goodsInfoAndAttrValueDto.getCarrierName() + goodsInfoAndAttrValueDto.getGroupName());
        String smFN = reRedioValue(goodsInfoAndAttrValueDto.getF3());
        if (StringUtils.equals(smFN, "可二次实名")) {
            params2.put("canreal", 1);
        } else {
            params2.put("canreal", 2);
        }
        return params2;
    }

    HashMap sjzxdInfo(GoodsInfoAndAttrValueDto goodsInfoAndAttrValueDto, HashMap<String, Object> params2) {
        params2.put("area", goodsInfoAndAttrValueDto.getCarrierName() + goodsInfoAndAttrValueDto.getGroupName());
        String smFN = reRedioValue(goodsInfoAndAttrValueDto.getF7());
        if (StringUtils.equals(smFN, "可二次实名")) {
            params2.put("canreal", 1);
        } else {
            params2.put("canreal", 2);
        }
        return params2;
    }

    HashMap jcczzInfo(GoodsInfoAndAttrValueDto goodsInfoAndAttrValueDto, HashMap<String, Object> params2) {
        params2.put("game", 2648);
        params2.put("area", goodsInfoAndAttrValueDto.getCarrierName()+goodsInfoAndAttrValueDto.getGroupName());

        String roleIds = "";
        if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF2())){
            JSONObject jsonObject = JSONObject.parseObject(jccxxyx);
            String data = jsonObject.getString("data");
            List<JSONObject> jsonObjects = JSONObject.parseArray(data, JSONObject.class);
            List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF2());
            for(GameAttribute gameAttribute1 : gameAttributs){
                for(JSONObject o : jsonObjects){
                    if(gameAttribute1.getFieldName().contains(o.getString("rolename"))){
                        roleIds+=","+o.getString("id");
                    }
                }
            }
        }
        params2.put("role", roleIds);
        params2.put("bface", 0);
        params2.put("canreal", 2);
        return params2;
    }
    HashMap wwqyInfo(GoodsInfoAndAttrValueDto goodsInfoAndAttrValueDto, HashMap<String, Object> params2) {
        params2.put("game", 2223);
        params2.put("area", 2643);
        params2.put("bface", 0);
        if(StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF1())){
            GameAttribute gameAttribute1 = gameAttributeMapper.selectGameAttributeById(Long.valueOf(goodsInfoAndAttrValueDto.getF1()));
            if(gameAttribute1.getFieldName().equals("可二次实名")){
                params2.put("canreal", 1);
            }else if(gameAttribute1.getFieldName().equals("不可二次实名")){
                params2.put("canreal", 2);
            }else {
                params2.put("canreal", 2);
            }
        }
        String roleIds = "4159";
        if(StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF1())){
            String string = "[{\"id\":4161,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"不可二次实名\"},{\"id\":4162,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"可二次实名\"},{\"id\":4163,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"支持人脸包赔\"}]\n";
            JSONArray jsonArray = JSONArray.parseArray(string);
            GameAttribute gameAttribute1 = gameAttributeMapper.selectGameAttributeById(Long.valueOf(goodsInfoAndAttrValueDto.getF1()));
            for(Object o : jsonArray){
                if(JSONObject.parseObject(o.toString()).getString("rolename").equals(gameAttribute1.getFieldName())){
                    roleIds+=","+JSONObject.parseObject(o.toString()).getString("id");
                }
            }
        }
        if(StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF2())){
            List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF2());
            String string = "[{\"id\":4164,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"砰砰X特攻队套装\"},{\"id\":4165,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"紫阙金琅套装\"},{\"id\":4166,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"无畏启程套装\"},{\"id\":5151,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"异形猎人套装\"},{\"id\":5152,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"偃月苍龙套装\"},{\"id\":5153,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"起源套装\"},{\"id\":5154,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"归零者套装\"},{\"id\":5683,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"奇点套装\"},{\"id\":5684,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"盖亚的复仇套装\"},{\"id\":5685,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"侦查力量套装\"},{\"id\":5686,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"白日幻梦套装\"},{\"id\":5687,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"冰点凝冻套装\"},{\"id\":5688,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"灵魂冲击套装\"},{\"id\":5689,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"晶态集成套装\"},{\"id\":5690,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"天界神兵套装\"},{\"id\":5691,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"盖世英雄套装\"},{\"id\":5692,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"光明哨兵2.0套装\"},{\"id\":6713,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"2023冠军套装\"},{\"id\":6714,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"机动狂飙套装\"},{\"id\":6715,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"全息波普套装\"},{\"id\":6716,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"破败军械套装\"},{\"id\":6717,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"塑水宗套装\"},{\"id\":6718,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"金角生辉套装\"},{\"id\":6719,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"781-A协议套装\"},{\"id\":6720,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"2021全球冠军赛套装\"},{\"id\":6721,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"源能者危机001套装\"},{\"id\":6722,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"堕天遗武套装\"},{\"id\":6723,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"洪荒怒焰套装\"},{\"id\":6724,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"耀鳞威龙套装\"},{\"id\":6783,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"MK.Vll 自由强袭\"},{\"id\":6784,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"萌彩剪影套装\"},{\"id\":6785,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"光导纤维套装\"},{\"id\":6786,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"胡桃狂想套装\"},{\"id\":6787,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"弧光异彩套装\"},{\"id\":6788,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"命运之手套装\"},{\"id\":6789,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"赛博迷城套装\"},{\"id\":6790,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"漫天彩霞套装\"},{\"id\":6791,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"奇幻朋克套装\"},{\"id\":6792,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"皓月幽森套装\"},{\"id\":6793,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"复古浪潮套装\"},{\"id\":6794,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"般若假面套装\"},{\"id\":6795,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"战术小伙伴套装\"},{\"id\":6796,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"信手涂鸦套装\"},{\"id\":6797,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"沙尘幻旅套装\"},{\"id\":6798,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"珍珠棘贝套装\"},{\"id\":6799,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"沙场老兵套装\"},{\"id\":6800,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"神罚套装\"},{\"id\":6801,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"永恒之砂套装\"},{\"id\":6802,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"泰坦兵器套装\"},{\"id\":6803,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"魄月玄兔套装\"},{\"id\":6804,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"无人之境套装\"},{\"id\":6805,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"无畏契约GO！第一卷套装\"},{\"id\":6806,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"无畏契约GO！第二卷套装\"},{\"id\":6807,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"巨神铁甲套装\"},{\"id\":6808,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"橙色疾影套装\"},{\"id\":6809,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"迷邃星云套装\"},{\"id\":6810,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"无限星环套装\"},{\"id\":6811,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"异彩晶棱套装\"},{\"id\":6812,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"猩红猛兽套装\"},{\"id\":6813,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"紫阙金琅 2.0套装\"},{\"id\":6814,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"盖亚的复仇2.0套装\"},{\"id\":6815,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"红鳞松叶套装\"},{\"id\":6817,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"虎魄春明套装\"},{\"id\":6818,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"铬金引擎套装\"},{\"id\":6819,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"钢轨卫士套装\"},{\"id\":6820,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"天界神兵2.0套装\"}]\n";
            JSONArray jsonArray = JSONArray.parseArray(string);
            for(GameAttribute gameAttribute1 : gameAttributs){
                for(Object o : jsonArray){
                    if(gameAttribute1.getFieldName().contains(JSONObject.parseObject(o.toString()).getString("rolename"))){
                        roleIds+=","+JSONObject.parseObject(o.toString()).getString("id");
                    }
                }
            }
        }
        if(StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF3())){
            List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF3());
            String string = "[{\"id\":4183,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"无畏契约Go！第一卷苦无\"},{\"id\":4184,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"离火刃\"},{\"id\":4185,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"极速橙风爪刀\"},{\"id\":4186,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"青瓷花剑\"},{\"id\":4187,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"哥特废墟匕首\"},{\"id\":4188,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"合金突袭军刀\"},{\"id\":4189,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"合金战车军刀\"},{\"id\":4190,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"源晶战刀\"},{\"id\":4191,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"809特遣队军刀\"},{\"id\":4192,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"创世之弧\"},{\"id\":4193,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"打击力量军刀\"},{\"id\":4194,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"地面效应军刀\"},{\"id\":4195,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"缚魔武器\"},{\"id\":4196,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"高分子科技涂层军刀\"},{\"id\":4197,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"黑曜\"},{\"id\":4198,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"虹光荆棘环刃\"},{\"id\":4199,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"金琅斧\"},{\"id\":4200,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"金属浪潮军刀\"},{\"id\":4201,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"狂切\"},{\"id\":4202,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"迷邃星云军刀\"},{\"id\":4203,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"赛尔凯特之刃\"},{\"id\":4204,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"神罚军刀\"},{\"id\":4205,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"视界洞穿\"},{\"id\":4206,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"泰坦刺锤\"},{\"id\":4207,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"天籁之钢\"},{\"id\":4208,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"无人之境军刀\"},{\"id\":4209,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"系统故障修理器\"},{\"id\":4210,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"异彩晶棱军刀\"},{\"id\":4211,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"异彩晶棱III战斧\"},{\"id\":4212,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"灼骨锤\"},{\"id\":5156,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"2023全球冠军赛苦无\"},{\"id\":5157,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"剥皮小刀\"},{\"id\":5158,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"定海神珍\"},{\"id\":5159,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"天玄刀\"},{\"id\":5160,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"沙尘幻旅匕首\"},{\"id\":5161,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"巨神铁甲短剑\"},{\"id\":5162,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"生物收割器\"},{\"id\":5163,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"起源环刃\"},{\"id\":5164,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"盖亚之愠\"},{\"id\":5165,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"偃月\"},{\"id\":5166,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"冰点凝冻动力锤\"},{\"id\":5167,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"白日梦幻撬棍\"},{\"id\":5168,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"澄湖潋滟\"},{\"id\":5169,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"虫巢心智短剑\"},{\"id\":5170,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"盖亚之怒\"},{\"id\":5171,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"硅晶刻刀\"},{\"id\":5172,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"弧光异彩军刀\"},{\"id\":5173,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"祜刀\"},{\"id\":5174,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"蓝粼战斧\"},{\"id\":5175,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"灵魂冲击镰刀\"},{\"id\":5176,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"魄月玄刃\"},{\"id\":5177,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"侦查力量蝴蝶刀\"},{\"id\":6821,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"橙色疾影\"},{\"id\":6822,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"般若长牙\"},{\"id\":6823,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"天御刀\"},{\"id\":6824,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"命运权杖\"},{\"id\":6825,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"珍珠棘背\"},{\"id\":6826,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"洪荒双斩\"},{\"id\":6827,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"MK.VI 自由强袭 军刀\"},{\"id\":6828,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"耀鳞威龙\"},{\"id\":6829,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"冥铁骑士团\"},{\"id\":6830,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"钢轨卫士\"},{\"id\":6831,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"塑水宗\"},{\"id\":6832,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"机动狂飙\"},{\"id\":6833,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"铬金引擎\"},{\"id\":6834,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"光明哨兵2.0\"},{\"id\":6837,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"2021全球冠军赛爪子刀\"},{\"id\":6838,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"奇点军刀\"},{\"id\":6839,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"堕天遗武\"},{\"id\":6840,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"夜之蝴蝶\"},{\"id\":6841,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"个人近战单位\"},{\"id\":6842,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"紫金爪刀\"},{\"id\":6843,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"金角扇\"}]\n";
            JSONArray jsonArray = JSONArray.parseArray(string);
            for(GameAttribute gameAttribute1 : gameAttributs){
                for(Object o : jsonArray){
                    if(gameAttribute1.getFieldName().contains(JSONObject.parseObject(o.toString()).getString("rolename"))){
                        roleIds+=","+JSONObject.parseObject(o.toString()).getString("id");
                    }
                }
            }
        }
        String pfIds = "";
        pfIds = reIds(pfIds, goodsInfoAndAttrValueDto.getF14());
        pfIds = reIds(pfIds, goodsInfoAndAttrValueDto.getF15());
        pfIds = reIds(pfIds, goodsInfoAndAttrValueDto.getF16());
        pfIds = reIds(pfIds, goodsInfoAndAttrValueDto.getF17());
        List<GameAttribute> gameAttributes = getGameAttributs(pfIds);
        if(CollectionUtils.isNotEmpty(gameAttributes)){
            String string = "[{\"id\":4213,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"砰砰X特攻队幻影\"},{\"id\":4215,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"紫阙金琅狂徒\"},{\"id\":4217,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"猩红猛兽狂徒\"},{\"id\":4218,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"迷邃星云幻影\"},{\"id\":4219,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"赛博迷城幻影\"},{\"id\":4220,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"无畏契约GO！第一卷幻影\"},{\"id\":4221,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"无垠星环幻影\"},{\"id\":4222,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"无人之境狂徒\"},{\"id\":4223,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"赛博迷城獠犬\"},{\"id\":4225,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"无人之境戍卫\"},{\"id\":4226,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"无畏契约GO！第一卷戍卫\"},{\"id\":4227,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"紫阙金琅戍卫\"},{\"id\":4228,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"创世纪獠犬\"},{\"id\":4229,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"缚魔武器獠犬\"},{\"id\":4230,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"极速橙风獠犬\"},{\"id\":4231,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"金属浪潮獠犬\"},{\"id\":4232,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"金纹世家獠犬\"},{\"id\":4233,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"漫天彩霞獠犬\"},{\"id\":4234,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"源晶工程獠犬\"},{\"id\":4235,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"哥特废墟戍卫\"},{\"id\":4236,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"迷邃星云戍卫\"},{\"id\":4237,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"天籁之钢戍卫\"},{\"id\":5179,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"盖世英雄狂徒\"},{\"id\":5180,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"天界神兵戍卫\"},{\"id\":5181,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"盖亚的复仇狂徒\"},{\"id\":5182,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"冰点凝冻狂徒\"},{\"id\":5183,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"侦察力量幻影\"},{\"id\":5184,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"奇点幻影\"},{\"id\":5185,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"灵魂冲击幻影\"},{\"id\":5186,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"冰点凝冻獠犬\"},{\"id\":5187,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"侦察力量成卫\"},{\"id\":5188,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"灵魂冲击戍卫\"},{\"id\":5189,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"盖亚的复仇戍卫\"},{\"id\":5190,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"偃月苍龙狂徒\"},{\"id\":5191,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"归零者狂徒\"},{\"id\":5192,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"归零者獠犬\"},{\"id\":5193,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"起源狂徒\"},{\"id\":5194,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"盖亚的复仇幻影\"},{\"id\":6875,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"堕天遗武狂徒\"},{\"id\":6876,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"机动狂飙狂徒\"},{\"id\":6877,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"2021全球冠军赛狂徒\"},{\"id\":6878,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"2023全球冠军赛狂徒\"},{\"id\":6879,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"耀鳞威龙狂徒\"},{\"id\":6880,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"塑水宗狂徒\"},{\"id\":6881,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"天界神兵2.0幻影\"},{\"id\":6882,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"噬源兽防卫工程幻影\"},{\"id\":6883,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"般若假面幻影\"},{\"id\":6884,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"781-A协议幻影\"},{\"id\":6885,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"光明哨兵2.0幻影\"},{\"id\":6886,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"紫阙金琅2.0幻影\"},{\"id\":6887,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"异形猎人幻影\"},{\"id\":6888,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"破败军械戍卫\"},{\"id\":6889,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"781-A协议獠犬\"},{\"id\":7237,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"洪荒怒焰幻影\"},{\"id\":7238,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"洪荒怒焰狂徒\"},{\"id\":7239,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"破败军械幻影\"},{\"id\":7240,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"千灵华绽幻影\"},{\"id\":7241,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"全息波普獠犬\"},{\"id\":7242,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"源能者危机001幻影\"},{\"id\":7243,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"无畏契约GO！第二狂徒\"},{\"id\":7244,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"金角生辉幻影\"},{\"id\":7245,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"海洋之星戍卫\"},{\"id\":7246,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"海洋之星狂徒\"},{\"id\":7247,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"般若假面戍卫\"},{\"id\":7248,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"珍珠棘贝戍卫\"},{\"id\":7249,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"珍珠棘贝幻影\"},{\"id\":7250,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"战术熊与伙伴们戍卫\"},{\"id\":7251,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"战术小伙伴獠犬\"},{\"id\":7252,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"战术小伙伴幻影\"},{\"id\":7253,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"涂鸦艺廊戍卫\"},{\"id\":7254,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"涂鸦艺廊幻影\"},{\"id\":7255,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"神罚幻影\"},{\"id\":7256,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"沙场老兵戍卫\"},{\"id\":7257,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"命运之手戍卫\"},{\"id\":7258,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"命运之手幻影\"},{\"id\":7259,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"萌彩剪影戍卫\"},{\"id\":7260,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"晶态集成戍卫\"},{\"id\":7261,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"胡桃狂想獠犬\"},{\"id\":7262,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"合金突袭狂徒\"},{\"id\":7263,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"钢轨卫士戍卫\"},{\"id\":7264,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"钢轨卫士狂徒\"},{\"id\":7265,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"多边形獠犬\"},{\"id\":7266,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"炽红快攻獠犬\"},{\"id\":7267,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"炽红快攻幻影\"},{\"id\":7268,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"橙色疾影幻影\"},{\"id\":7269,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"彩梦之城戍卫\"},{\"id\":7270,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"白日幻梦幻影\"},{\"id\":7271,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"幽海幻潮戍卫\"},{\"id\":7272,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"幽海幻潮幻影\"},{\"id\":7273,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"永恒之砂狂徒\"},{\"id\":7274,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"永恒之砂幻影\"},{\"id\":7275,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"异彩晶棱幻影\"},{\"id\":7276,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"炫彩澎湃狂徒\"},{\"id\":7277,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"王牌队员狂徒\"},{\"id\":7278,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"王牌队员幻影\"},{\"id\":7279,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"泰坦兵器狂徒\"}]\n";
            JSONArray jsonArray = JSONArray.parseArray(string);
            for(GameAttribute gameAttribute1 : gameAttributes){
                String fieldName = gameAttribute1.getFieldName();
                if(fieldName.contains("-")){
                    fieldName = fieldName.split("-")[1]+fieldName.split("-")[0];
                }
                for(Object o : jsonArray){
                    if(fieldName.equals(JSONObject.parseObject(o.toString()).getString("rolename"))){
                        roleIds+=","+JSONObject.parseObject(o.toString()).getString("id");
                    }
                }
            }
        }
        pfIds = "";
        pfIds = reIds(pfIds, goodsInfoAndAttrValueDto.getF18());
        pfIds = reIds(pfIds, goodsInfoAndAttrValueDto.getF19());
        pfIds = reIds(pfIds, goodsInfoAndAttrValueDto.getF20());
        gameAttributes = getGameAttributs(pfIds);
        if(CollectionUtils.isNotEmpty(gameAttributes)){
            String string = "[{\"id\":4238,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"猩红猛兽飞将\"},{\"id\":4239,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"无垠星环冥驹\"},{\"id\":5195,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"盖世英雄冥驹\"},{\"id\":5196,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"天界神兵飞将\"},{\"id\":5197,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"归零者冥驹\"},{\"id\":5198,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"起源冥驹\"},{\"id\":5199,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"偃月苍龙冥驹\"},{\"id\":5200,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"盖亚的复仇飞将\"},{\"id\":5201,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"冰点凝冻冥驹\"},{\"id\":6871,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"塑水宗飞将\"},{\"id\":6872,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"奇幻朋克飞将\"},{\"id\":6873,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"堕天遗武冥驹\"},{\"id\":6874,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"冰点凝冻冥驹\"}]\n";
            JSONArray jsonArray = JSONArray.parseArray(string);
            for(GameAttribute gameAttribute1 : gameAttributes){
                String fieldName = gameAttribute1.getFieldName();
                if(fieldName.contains("-")){
                    fieldName = fieldName.split("-")[1]+fieldName.split("-")[0];
                }
                for(Object o : jsonArray){
                    if(fieldName.equals(JSONObject.parseObject(o.toString()).getString("rolename"))){
                        roleIds+=","+JSONObject.parseObject(o.toString()).getString("id");
                    }
                }
            }
        }
        pfIds = "";
        pfIds = reIds(pfIds, goodsInfoAndAttrValueDto.getF4());
        pfIds = reIds(pfIds, goodsInfoAndAttrValueDto.getF5());
        pfIds = reIds(pfIds, goodsInfoAndAttrValueDto.getF6());
        pfIds = reIds(pfIds, goodsInfoAndAttrValueDto.getF7());
        pfIds = reIds(pfIds, goodsInfoAndAttrValueDto.getF8());
        pfIds = reIds(pfIds, goodsInfoAndAttrValueDto.getF9());
        gameAttributes = getGameAttributs(pfIds);
        if(CollectionUtils.isNotEmpty(gameAttributes)){
            String string = "[{\"id\":4240,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"双城之战正义\"},{\"id\":4241,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"砰砰X特攻队狂怒\"},{\"id\":4242,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"无畏契约GO！第一卷鬼魅\"},{\"id\":4243,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"紫阙金琅标配\"},{\"id\":4244,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"赛博迷城标配\"},{\"id\":4245,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"无垠星环标配\"},{\"id\":4246,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"无人之境鬼魅\"},{\"id\":4247,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"迷邃星云正义\"},{\"id\":4248,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"猩红猛兽正义\"},{\"id\":4249,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"809特遣队狂怒\"},{\"id\":4250,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"地面效应狂怒\"},{\"id\":4251,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"漫天彩霞狂怒\"},{\"id\":4252,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"泰坦兵器狂怒\"},{\"id\":4253,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"创世纪短炮\"},{\"id\":4254,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"废土短炮\"},{\"id\":4255,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"哥特废墟短炮\"},{\"id\":4256,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"极速橙风短炮\"},{\"id\":4257,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"金属浪潮短炮\"},{\"id\":5202,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"天界神兵鬼魅\"},{\"id\":5203,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"异形猎人狂怒\"},{\"id\":5204,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"盖世英雄鬼魅\"},{\"id\":5205,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"侦查力量鬼魅\"},{\"id\":5206,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"灵魂冲击鬼魅\"},{\"id\":5207,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"盖亚的复仇鬼魅\"},{\"id\":5208,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"冰点凝冻标配\"},{\"id\":5209,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"奇点正义\"},{\"id\":5210,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"偃月苍龙正义\"},{\"id\":5211,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"盖亚的复仇短炮\"},{\"id\":5212,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"归零者短炮\"},{\"id\":6845,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"堕天遗武标配\"},{\"id\":6846,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"无限星环标配\"},{\"id\":6847,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"全息波普狂怒\"},{\"id\":6848,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"天界神兵2.0狂怒\"},{\"id\":6849,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"起源狂怒\"},{\"id\":6850,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"紫阙金琅狂怒\"},{\"id\":6852,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"弧光异彩短炮\"},{\"id\":6853,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"光明哨兵2.0短炮\"},{\"id\":6854,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"洪荒怒焰短炮\"},{\"id\":6855,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"般若假面短炮\"},{\"id\":6856,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"传奇制造正义\"},{\"id\":6857,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"781-A协议正义\"},{\"id\":6858,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"机动狂飙正义\"},{\"id\":6859,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"塑水宗正义\"},{\"id\":6860,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"破败军械鬼魅\"},{\"id\":6861,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"耀鱗威龙鬼魅\"},{\"id\":6862,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"奇幻朋克鬼魅\"}]\n";
            JSONArray jsonArray = JSONArray.parseArray(string);
            for(GameAttribute gameAttribute1 : gameAttributes){
                String fieldName = gameAttribute1.getFieldName();
                if(fieldName.contains("-")){
                    fieldName = fieldName.split("-")[1]+fieldName.split("-")[0];
                }
                for(Object o : jsonArray){
                    if(fieldName.equals(JSONObject.parseObject(o.toString()).getString("rolename"))){
                        roleIds+=","+JSONObject.parseObject(o.toString()).getString("id");
                    }
                }
            }
        }
        pfIds = "";
        pfIds = reIds(pfIds, goodsInfoAndAttrValueDto.getF21());
        pfIds = reIds(pfIds, goodsInfoAndAttrValueDto.getF22());
        gameAttributes = getGameAttributs(pfIds);
        if(CollectionUtils.isNotEmpty(gameAttributes)){
            String string = "[{\"id\":4258,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"迷邃星云战神\"},{\"id\":4259,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"砰砰X特攻队奥丁\"},{\"id\":5213,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"异形猎人奥丁\"},{\"id\":5214,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"盖世英雄战神\"},{\"id\":5215,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"奇点战神\"},{\"id\":5216,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"盖亚的复仇战神\"},{\"id\":6863,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"战场老兵战神\"},{\"id\":6864,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"战术小伙伴奥丁\"},{\"id\":6865,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"巨神铁甲奥丁\"},{\"id\":6866,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"天界神兵2.0奥丁\"},{\"id\":6867,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"全息波普奥丁\"},{\"id\":6868,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"紫网金琅//2.0奥丁\"},{\"id\":6869,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"光明哨兵2.0奥丁\"},{\"id\":6870,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"异形猎人奥丁\"}]\n\n";
            JSONArray jsonArray = JSONArray.parseArray(string);
            for(GameAttribute gameAttribute1 : gameAttributes){
                String fieldName = gameAttribute1.getFieldName();
                if(fieldName.contains("-")){
                    fieldName = fieldName.split("-")[1]+fieldName.split("-")[0];
                }
                for(Object o : jsonArray){
                    if(fieldName.equals(JSONObject.parseObject(o.toString()).getString("rolename"))){
                        roleIds+=","+JSONObject.parseObject(o.toString()).getString("id");
                    }
                }
            }
        }
        pfIds = "";
        pfIds = reIds(pfIds, goodsInfoAndAttrValueDto.getF10());
        pfIds = reIds(pfIds, goodsInfoAndAttrValueDto.getF11());
        gameAttributes = getGameAttributs(pfIds);
        if(CollectionUtils.isNotEmpty(gameAttributes)){
            String string = "[{\"id\":4260,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"砰砰X特工队骇灵\"},{\"id\":4261,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"无畏契约GO！第一卷骇灵\"},{\"id\":4262,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"无垠星环骇灵\"},{\"id\":4263,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"紫阙金琅骇灵\"},{\"id\":4264,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"赛博迷城判官\"},{\"id\":4265,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"猩红猛兽判官\"},{\"id\":4266,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"皓月幽森蜂刺\"},{\"id\":4267,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"合金战车蜂刺\"},{\"id\":4268,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"金纹世家蜂刺\"},{\"id\":4269,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"狼人猎手蜂刺\"},{\"id\":4270,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"赛博奇兵蜂刺\"},{\"id\":4271,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"铁甲骑兵蜂刺\"},{\"id\":4272,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"无人之境蜂刺\"},{\"id\":4273,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"809特遣队骇灵\"},{\"id\":4274,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"地面效应骇灵\"},{\"id\":4275,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"废土骇灵\"},{\"id\":4276,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"寒冬兵器骇灵\"},{\"id\":4277,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"极速橙风骇灵\"},{\"id\":4278,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"漫天彩霞骇灵\"},{\"id\":4279,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"异彩晶棱骇灵\"},{\"id\":4280,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"永恒之砂骇灵\"},{\"id\":4281,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"创世纪雄鹿\"},{\"id\":4282,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"虹光荆棘雄鹿\"},{\"id\":4283,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"匠心瓷绘雄鹿\"},{\"id\":4284,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"漫天彩霞雄鹿\"},{\"id\":4285,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"赛博奇兵雄鹿\"},{\"id\":4286,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"太阳之石雄鹿\"},{\"id\":4287,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"泰坦兵器雄鹿\"},{\"id\":4288,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"铁甲骑兵雄鹿\"},{\"id\":4289,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"缚魔武器判官\"},{\"id\":4290,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"虹光荆棘判官\"},{\"id\":4291,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"金属浪潮判官\"},{\"id\":4292,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"太阳之石判官\"},{\"id\":5217,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"偃月苍龙判官\"},{\"id\":5219,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"异形猎人雄鹿\"},{\"id\":5220,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"灵魂冲击骇灵\"},{\"id\":5221,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"奇点骇灵\"},{\"id\":5222,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"天界神兵蜂刺\"},{\"id\":5223,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"侦查力量骇灵\"},{\"id\":5224,\"gameid\":2223,\"gamename\":\"无畏契约\",\"rolename\":\"起源雄鹿\"}]\n";
            JSONArray jsonArray = JSONArray.parseArray(string);
            for(GameAttribute gameAttribute1 : gameAttributes){
                String fieldName = gameAttribute1.getFieldName();
                if(fieldName.contains("-")){
                    fieldName = fieldName.split("-")[1]+fieldName.split("-")[0];
                }
                for(Object o : jsonArray){
                    if(fieldName.equals(JSONObject.parseObject(o.toString()).getString("rolename"))){
                        roleIds+=","+JSONObject.parseObject(o.toString()).getString("id");
                    }
                }
            }
        }
        if (StringUtils.isNotEmpty(roleIds)) {
            params2.put("role", roleIds.replaceFirst(",", ""));
        }
        return params2;
    }
    HashMap yjwjsyInfo(GoodsInfoAndAttrValueDto goodsInfoAndAttrValueDto, HashMap<String, Object> params2,String pf_ids) {
        params2.put("game", 2720);
        params2.put("area", 2721);
        if(StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF23())){
            GameAttribute gameAttribute1 = gameAttributeMapper.selectGameAttributeById(Long.valueOf(goodsInfoAndAttrValueDto.getF23()));
            if(gameAttribute1.getFieldName().equals("未绑定")){
                pf_ids+=",8611";
            }else {
                pf_ids+=",8612";
            }
        }
        return params2;
    }
    HashMap yjwjInfo(GoodsInfoAndAttrValueDto goodsInfoAndAttrValueDto, HashMap<String, Object> params2) {
        params2.put("game", 2006);
        if(goodsInfoAndAttrValueDto.getGroupName().contains("网易")){
            params2.put("area", 2008);
        }else if(goodsInfoAndAttrValueDto.getGroupName().contains("Steam")){
            params2.put("area", 2007);
        }else {
            params2.put("area", 2120);
        }
        params2.put("canreal", 1);
        return params2;
    }
    HashMap yxlmsyInfo(GoodsInfoAndAttrValueDto goodsInfoAndAttrValueDto, HashMap<String, Object> params2) {
        if(StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF4())){
            GameAttribute gameAttribute1 = gameAttributeMapper.selectGameAttributeById(Long.valueOf(goodsInfoAndAttrValueDto.getF4()));
            if(gameAttribute1.getFieldName().equals("可二次实名")||gameAttribute1.getFieldName().equals("已删实名")){
                params2.put("canreal", 1);
            }else if(gameAttribute1.getFieldName().equals("不可二次实名")){
                params2.put("canreal", 2);
            }else if(gameAttribute1.getFieldName().equals("包人脸")){
                params2.put("canreal", 2);
            }
        }
        return params2;
    }
    HashMap smzhInfo(GoodsInfoAndAttrValueDto goodsInfoAndAttrValueDto, HashMap<String, Object> params2) {
        params2.put("game", 1978);
        String regional = goodsInfoAndAttrValueDto.getSystemName()+goodsInfoAndAttrValueDto.getCarrierName();
        if(regional.equals("安卓QQ")){
            params2.put("area", 1988);
        }else if(regional.equals("安卓微信")){
            params2.put("area", 1989);
        }else if(regional.equals("苹果qq")){
            params2.put("area", 1990);
        }else {
            params2.put("area", 1991);
        }
        return params2;
    }

    HashMap dnfInfo(GoodsInfoAndAttrValueDto goodsInfoAndAttrValueDto, HashMap<String, Object> params2) {
        params2.put("game", 1);
        String smFN = reRedioValue(goodsInfoAndAttrValueDto.getF1());
        params2.put("title", goodsInfoAndAttrValueDto.getDes().replace("+", "加"));
        String[] qufus = "广东区=3,北京区=4,四川区=5,江苏区=6,湖北区=7,广西区=8,东北区=9,浙江区=10,山东区=11,上海区=12,西南区=13,安徽区=14,河北区=15,辽宁区=16,福建区=17,华北区=18,重庆区=19,黑龙江区=20,江西区=21,西北区=22,陕西区=23,吉林区=24,山西区=25,天津区=27,河南区=28,湖南区=29,新疆区=30,内蒙古区=31,云贵区=32,体验区=33".split(",");
        for(String s : qufus){
            if(s.split("=")[0].contains(onlyHanZi(goodsInfoAndAttrValueDto.getServerName()))){
                params2.put("area", s.split("=")[1]);
                break;
            }
        }
        if(StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF2())){
            List<GameAttribute> gameAttributeList = getGameAttributs(goodsInfoAndAttrValueDto.getF2());
            String[] roles = "鬼剑士=11,女鬼剑=12,格斗家=13,男格斗=14,神枪手=15,女枪手=16,男法师=17,魔法师=18,暗夜使者=19,圣职者=20,外传职业=21,守护者=22,魔枪师=23,女圣职者=24,枪剑士=393,弓箭手=4135".split(",");
            String rols = "";
            for(GameAttribute gameAttribute1 : gameAttributeList){
                for(String s : roles){
                    if(gameAttribute1.getFieldName().equals(s.split("=")[0])){
                        rols+=","+s.split("=")[1];
                    }
                }
            }
            if(StringUtils.isNotEmpty(rols)){
                params2.put("role", rols.substring(1));
            }
        }
        return params2;
    }

    HashMap hyrzInfo(GoodsInfoAndAttrValueDto goodsInfoAndAttrValueDto, HashMap<String, Object> params2) {
        params2.put("game", 209);
        switch (goodsInfoAndAttrValueDto.getSystemName() + goodsInfoAndAttrValueDto.getCarrierName()) {
            case "安卓QQ":
                params2.put("area", 1929);
                break;
            case "安卓微信":
                params2.put("area", 1967);
                break;
            case "苹果QQ":
                params2.put("area", 1930);
                break;
            case "苹果微信":
                params2.put("area", 1968);
                break;
        }
        String roleIds = "";
        String smFN = reRedioValue(goodsInfoAndAttrValueDto.getF7());
        if (StringUtils.contains(smFN, "不可二次")) {
            params2.put("canreal", 2);
            params2.put("bface", 0);
        } else if (StringUtils.equals(smFN, "可改二次")) {
            params2.put("canreal", 1);
            params2.put("bface", 0);
        } else if (StringUtils.equals(smFN, "已删实名")) {
            params2.put("canreal", 1);
            params2.put("bface", 0);
        } else {
            params2.put("canreal", 2);
            params2.put("bface", 1);
        }
        params2.put("title", goodsInfoAndAttrValueDto
                .getDes().replace("+", "加"));

        if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF5())) {
            List<GameAttribute> gameAttributes = getGameAttributs(goodsInfoAndAttrValueDto.getF5());
            if (CollectionUtils.isNotEmpty(gameAttributes)) {
                String srzs = "纲手=1120,百豪纲手=1121,猿飞日斩=1122,自来也=1123,仙人自来也=1124,大蛇丸=1125,波风水门=1126,秽土波风水门=1127,秽土猿飞日斩=1128,千手扉间=1129,秽土扉间=1130," +
                        "千手柱间=1131,宇智波斑=1132,须佐能乎鼬=1133,神秘面具男=1134,鬼灯幻月=1135,四代目雷影=1136,金角银角=1137,天道佩恩=1138,长门=1139,无=1140,大野木=1141,半藏=1142," +
                        "白面具=1143,秽土斑=1144,三代目雷影=1145,仙人兜=3140";
                Map jiaoseMap = stringTOmap(srzs);
                for (GameAttribute gameAttribute : gameAttributes) {
                    String srz = gameAttribute.getFieldName();
                    if (Objects.nonNull(jiaoseMap.get(srz))) {
                        roleIds = roleIds + "," + jiaoseMap.get(srz);
                    }
                }
            }
        }
        if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF6())) {
            List<GameAttribute> gameAttributes = getGameAttributs(goodsInfoAndAttrValueDto.getF6());
            if (CollectionUtils.isNotEmpty(gameAttributes)) {
                String arzs = "宇智波佐助=1146,百豪樱=1147,旗木卡卡西=1148,疾风我爱罗=1149,晓蛇=1150,仙鸣人=1151,迈特凯=1152,猿飞阿斯玛=1153,蝎=1154,干柿鬼鲛=1155,飞段=1156,宇智波止水=1157," +
                        "死司飞段=1158,秽土阿斯玛=1159,地陆=1160,忍界我爱罗=1161,忍界勘九郎=1162,照美冥=1163,奇拉比=1164,小南=1165,角都=1166,宇智波鼬=1167,新春鼬=1168,迪达拉=1169," +
                        "疾风佐助=1170,秋道丁次=1171,惊门凯=1172,志村团藏=1173,猿飞日斩=1174,新春水门=1175,千代=1176,桃地再不斩=1177,达鲁伊=1178,三船=1179,兜=1180,泳装小南=1181,绝=1182," +
                        "地元角都=1183,百机蝎=1184,鲛肌鬼鲛=1185,阿飞=1186,忍界黄图=1187";
                Map arzMap = stringTOmap(arzs);
                for (GameAttribute gameAttribute : gameAttributes) {
                    String arz = gameAttribute.getFieldName();
                    if (Objects.nonNull(arzMap.get(arz))) {
                        roleIds = roleIds + "," + arzMap.get(arz);
                    }
                }
            }
        }
        if (StringUtils.isNotEmpty(roleIds)) {
            params2.put("role", roleIds.replaceFirst(",", ""));
        }
        return params2;
    }

    HashMap ysInfo(GoodsInfoAndAttrValueDto goodsInfoAndAttrValueDto, HashMap<String, Object> params2) {
        params2.put("game", 1970);
        switch (goodsInfoAndAttrValueDto.getGroupName()) {
            case "B站专区":
                params2.put("area", 1998);
                break;
            case "米哈游官服":
                params2.put("area", 1972);
                break;
        }
        String roleIds = "";
        String smFN = reRedioValue(goodsInfoAndAttrValueDto.getF20());
        String sm = "已实名=1754,未实名=1755";
        if (StringUtils.contains(smFN, "有修改人脸机会") || StringUtils.equals(smFN, "可修改邮箱")) {
            params2.put("canreal", 1);
            params2.put("bface", 0);
            roleIds = roleIds + "," + "1754";
        } else if (StringUtils.equals(smFN, "已删人脸实名可随时认证")) {
            params2.put("canreal", 1);
            params2.put("bface", 0);
            roleIds = roleIds + "," + "1755";
        } else {
            params2.put("canreal", 2);
            params2.put("bface", 0);
            roleIds = roleIds + "," + "1754";
        }
        params2.put("title", goodsInfoAndAttrValueDto
                .getDes().replace("+", "加"));

        if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF11())) {
            List<GameAttribute> gameAttributes = getGameAttributs(goodsInfoAndAttrValueDto.getF11());
            if (CollectionUtils.isNotEmpty(gameAttributes)) {
                String jiaose = "[{\"id\":802,\"gameid\":1970,\"gamename\":\"原神\",\"rolename\":\"甘雨\"},{\"id\":803,\"gameid\":1970,\"gamename\":\"原神\",\"rolename\":\"阿贝多\"},{\"id\":804,\"gameid\":1970,\"gamename\":\"原神\",\"rolename\":\"刻晴\"},{\"id\":805,\"gameid\":1970,\"gamename\":\"原神\",\"rolename\":\"莫娜\"},{\"id\":806,\"gameid\":1970,\"gamename\":\"原神\",\"rolename\":\"七七\"},{\"id\":807,\"gameid\":1970,\"gamename\":\"原神\",\"rolename\":\"迪卢克\"},{\"id\":808,\"gameid\":1970,\"gamename\":\"原神\",\"rolename\":\"琴\"},{\"id\":809,\"gameid\":1970,\"gamename\":\"原神\",\"rolename\":\"可莉\"},{\"id\":810,\"gameid\":1970,\"gamename\":\"原神\",\"rolename\":\"温迪\"},{\"id\":811,\"gameid\":1970,\"gamename\":\"原神\",\"rolename\":\"钟离\"},{\"id\":812,\"gameid\":1970,\"gamename\":\"原神\",\"rolename\":\"达达利亚\"},{\"id\":814,\"gameid\":1970,\"gamename\":\"原神\",\"rolename\":\"魈\"},{\"id\":833,\"gameid\":1970,\"gamename\":\"原神\",\"rolename\":\"胡桃\"},{\"id\":1675,\"gameid\":1970,\"gamename\":\"原神\",\"rolename\":\"雷电将军\"},{\"id\":1676,\"gameid\":1970,\"gamename\":\"原神\",\"rolename\":\"心海\"},{\"id\":1685,\"gameid\":1970,\"gamename\":\"原神\",\"rolename\":\"优菈\"},{\"id\":1686,\"gameid\":1970,\"gamename\":\"原神\",\"rolename\":\"万叶\"},{\"id\":1687,\"gameid\":1970,\"gamename\":\"原神\",\"rolename\":\"神里绫华\"},{\"id\":1688,\"gameid\":1970,\"gamename\":\"原神\",\"rolename\":\"宵宫\"},{\"id\":1736,\"gameid\":1970,\"gamename\":\"原神\",\"rolename\":\"荒泷一斗\"},{\"id\":1737,\"gameid\":1970,\"gamename\":\"原神\",\"rolename\":\"申鹤\"},{\"id\":1770,\"gameid\":1970,\"gamename\":\"原神\",\"rolename\":\"八重神子\"},{\"id\":1805,\"gameid\":1970,\"gamename\":\"原神\",\"rolename\":\"神里绫人\"},{\"id\":2092,\"gameid\":1970,\"gamename\":\"原神\",\"rolename\":\"夜兰\"},{\"id\":2612,\"gameid\":1970,\"gamename\":\"原神\",\"rolename\":\"纳西妲\"},{\"id\":2613,\"gameid\":1970,\"gamename\":\"原神\",\"rolename\":\"赛诺\"},{\"id\":2614,\"gameid\":1970,\"gamename\":\"原神\",\"rolename\":\"提纳里\"},{\"id\":3336,\"gameid\":1970,\"gamename\":\"原神\",\"rolename\":\"散兵\"},{\"id\":3390,\"gameid\":1970,\"gamename\":\"原神\",\"rolename\":\"艾尔海森\"},{\"id\":3492,\"gameid\":1970,\"gamename\":\"原神\",\"rolename\":\"迪希雅\"},{\"id\":3827,\"gameid\":1970,\"gamename\":\"原神\",\"rolename\":\"妮露\"},{\"id\":3829,\"gameid\":1970,\"gamename\":\"原神\",\"rolename\":\"白术\"},{\"id\":3831,\"gameid\":1970,\"gamename\":\"原神\",\"rolename\":\"流浪者\"},{\"id\":5051,\"gameid\":1970,\"gamename\":\"原神\",\"rolename\":\"林尼\"}]\n";
                JSONArray jsonArray = JSONArray.parseArray(jiaose);
                for (GameAttribute gameAttribute : gameAttributes) {
                    String fieldName = gameAttribute.getFieldName();
                    if(fieldName.contains("命")) {
                        fieldName = fieldName.split("命")[1] + fieldName.split("命")[0].replace("满", "6") + "命";
                    }
                    for(Object o : jsonArray){
                        if(fieldName.contains(JSONObject.parseObject(o.toString()).getString("rolename"))){
                            String response = shuxing(1970, JSONObject.parseObject(o.toString()).getInteger("id"));
                            String data = JSONObject.parseObject(response).getString("data");
                            JSONArray jsonArray1 = JSONArray.parseArray(data);
                            for(Object p : jsonArray1){
                                if(fieldName.contains(JSONObject.parseObject(p.toString()).getString("rolename"))){
                                    roleIds = roleIds + "," +JSONObject.parseObject(p.toString()).getString("id");
                                }
                            }
                        }
                    }
                }
            }
        }
        if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF17())) {
            List<GameAttribute> gameAttributes = getGameAttributs(goodsInfoAndAttrValueDto.getF17());
            if (CollectionUtils.isNotEmpty(gameAttributes)) {
                String wuqi = "[{\"id\":789,\"gameid\":1970,\"gamename\":\"原神\",\"rolename\":\"斫峰之刃\"},{\"id\":790,\"gameid\":1970,\"gamename\":\"原神\",\"rolename\":\"阿莫斯之弓\"},{\"id\":791,\"gameid\":1970,\"gamename\":\"原神\",\"rolename\":\"天空之翼\"},{\"id\":792,\"gameid\":1970,\"gamename\":\"原神\",\"rolename\":\"四风原典\"},{\"id\":793,\"gameid\":1970,\"gamename\":\"原神\",\"rolename\":\"天空之卷\"},{\"id\":794,\"gameid\":1970,\"gamename\":\"原神\",\"rolename\":\"和璞鸢\"},{\"id\":795,\"gameid\":1970,\"gamename\":\"原神\",\"rolename\":\"天空之脊\"},{\"id\":796,\"gameid\":1970,\"gamename\":\"原神\",\"rolename\":\"狼的末路\"},{\"id\":797,\"gameid\":1970,\"gamename\":\"原神\",\"rolename\":\"天空之傲\"},{\"id\":798,\"gameid\":1970,\"gamename\":\"原神\",\"rolename\":\"天空之刃\"},{\"id\":799,\"gameid\":1970,\"gamename\":\"原神\",\"rolename\":\"风鹰剑\"},{\"id\":800,\"gameid\":1970,\"gamename\":\"原神\",\"rolename\":\"尘世之锁\"},{\"id\":834,\"gameid\":1970,\"gamename\":\"原神\",\"rolename\":\"无工之剑\"},{\"id\":835,\"gameid\":1970,\"gamename\":\"原神\",\"rolename\":\"贯虹之槊\"},{\"id\":836,\"gameid\":1970,\"gamename\":\"原神\",\"rolename\":\"磐岩结绿\"},{\"id\":837,\"gameid\":1970,\"gamename\":\"原神\",\"rolename\":\"护摩之杖\"},{\"id\":1677,\"gameid\":1970,\"gamename\":\"原神\",\"rolename\":\"终末嗟叹之诗\"},{\"id\":1678,\"gameid\":1970,\"gamename\":\"原神\",\"rolename\":\"松籁响起之时 \"},{\"id\":1679,\"gameid\":1970,\"gamename\":\"原神\",\"rolename\":\"苍古自由之誓\"},{\"id\":1680,\"gameid\":1970,\"gamename\":\"原神\",\"rolename\":\"雾切之回光\"},{\"id\":1681,\"gameid\":1970,\"gamename\":\"原神\",\"rolename\":\"飞雷之弦振\"},{\"id\":1682,\"gameid\":1970,\"gamename\":\"原神\",\"rolename\":\"薙草之稻光\"},{\"id\":1683,\"gameid\":1970,\"gamename\":\"原神\",\"rolename\":\"不灭月华\"},{\"id\":1684,\"gameid\":1970,\"gamename\":\"原神\",\"rolename\":\"冬极白星\"},{\"id\":1738,\"gameid\":1970,\"gamename\":\"原神\",\"rolename\":\"赤角石溃杆\"},{\"id\":1739,\"gameid\":1970,\"gamename\":\"原神\",\"rolename\":\"息灾\"},{\"id\":1771,\"gameid\":1970,\"gamename\":\"原神\",\"rolename\":\"神乐之真意\"},{\"id\":1806,\"gameid\":1970,\"gamename\":\"原神\",\"rolename\":\"波乱月白经津\"},{\"id\":2093,\"gameid\":1970,\"gamename\":\"原神\",\"rolename\":\"若水\"},{\"id\":2610,\"gameid\":1970,\"gamename\":\"原神\",\"rolename\":\"千夜浮梦\"},{\"id\":2611,\"gameid\":1970,\"gamename\":\"原神\",\"rolename\":\"赤沙之杖\"},{\"id\":2615,\"gameid\":1970,\"gamename\":\"原神\",\"rolename\":\"阿尤斯之弓\"},{\"id\":3335,\"gameid\":1970,\"gamename\":\"原神\",\"rolename\":\"图莱杜拉的回忆\"},{\"id\":3391,\"gameid\":1970,\"gamename\":\"原神\",\"rolename\":\"裁叶萃光\"},{\"id\":3493,\"gameid\":1970,\"gamename\":\"原神\",\"rolename\":\"海信标\"},{\"id\":3833,\"gameid\":1970,\"gamename\":\"原神\",\"rolename\":\"碧落之珑\"},{\"id\":3834,\"gameid\":1970,\"gamename\":\"原神\",\"rolename\":\"苇海信标\"},{\"id\":3835,\"gameid\":1970,\"gamename\":\"原神\",\"rolename\":\"圣显之匙\"},{\"id\":3874,\"gameid\":1970,\"gamename\":\"原神\",\"rolename\":\"碧落之城\"},{\"id\":4127,\"gameid\":1970,\"gamename\":\"原神\",\"rolename\":\"猎人之径\"},{\"id\":5050,\"gameid\":1970,\"gamename\":\"原神\",\"rolename\":\"最初的大魔术\"}]\n";
                JSONArray jsonArray = JSONArray.parseArray(wuqi);
                for (GameAttribute gameAttribute : gameAttributes) {
                    String fieldName = gameAttribute.getFieldName();
                    for(Object o : jsonArray){
                        if(fieldName.contains(JSONObject.parseObject(o.toString()).getString("rolename"))){
                            String response = shuxing(1970, JSONObject.parseObject(o.toString()).getInteger("id"));
                            String data = JSONObject.parseObject(response).getString("data");
                            JSONArray jsonArray1 = JSONArray.parseArray(data);
                            for(Object p : jsonArray1){
                                if(JSONObject.parseObject(p.toString()).getString("rolename").contains(fieldName.substring(1,2))){
                                    roleIds = roleIds + "," +JSONObject.parseObject(p.toString()).getString("id");
                                }
                            }
                        }
                    }
                }
            }
        }

        if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF2())) {
            String csyxFN = reRedioValue(goodsInfoAndAttrValueDto.getF2());
//            String csyx = "邮箱出售=1751,邮箱不出售=1752";
            if (StringUtils.equals(csyxFN, "不送邮箱/死邮")) {
                roleIds = roleIds + "," + "1752";
            } else {
                roleIds = roleIds + "," + "1751";
            }
        }


        //        String bangding="tap可换绑=1743,tap已注销=1744,psn已绑定=1745";
        if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF4())) {
            String bangdingFN = reRedioValue(goodsInfoAndAttrValueDto.getF4());
            if (StringUtils.equals(bangdingFN, "是")) {
                roleIds = roleIds + "," + "1745";
            }
        }
        if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF5())) {
            String bangdingFN = reRedioValue(goodsInfoAndAttrValueDto.getF5());
            if (StringUtils.equals(bangdingFN, "否")) {
                roleIds = roleIds + "," + "1744";
            }
        }

        if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF1())) {
            String bdyxFN = reRedioValue(goodsInfoAndAttrValueDto.getF1());
            String bdyx = "网易邮箱账号=1746,QQ字母邮箱=1747,新浪邮箱=1748,QQ邮箱账号=1749,未绑邮箱=1750";
            Map bdyxMap = stringTOmap(bdyx);
            if (Objects.nonNull(bdyxMap.get(bdyxFN))) {
                roleIds = roleIds + "," + bdyxMap.get(bdyxFN);
            }
        }
        if (StringUtils.isNotEmpty(roleIds)) {
            params2.put("role", roleIds.replaceFirst(",", ""));
        }
        return params2;
    }

    private String reRedioValue(String value) {
        String reStr = "";
        if (StringUtils.isNotEmpty(value)) {
            GameAttribute gameAttribute =
                    gameAttributeService.selectGameAttributeById(Long.valueOf(value));
            if (gameAttribute != null) {
                if (StringUtils.isNotEmpty(gameAttribute.getFieldName())) {
                    reStr = gameAttribute.getFieldName();
                }

            }
        }
        return reStr;
    }

    /**
     * 提取字符串里的数字
     *
     * @param str
     * @return
     */
    String getNum(String str) {
        String result = "";
        if (StringUtils.isNotEmpty(str)) {
            String regEx = "[^0-9]";
            Pattern p = Pattern.compile(regEx);
            Matcher m = p.matcher(str);
            result = m.replaceAll("").trim();
        }
        return result;
    }

    /**
     * String字符串的值 =号拼接 转Map
     *
     * @param b
     * @return
     */
    static Map stringTOmap(String b) {
        Map docType = new HashMap();
        StringTokenizer items;
        for (StringTokenizer entrys = new StringTokenizer(b, ","); entrys.hasMoreTokens();
             docType.put(items.nextToken(), items.hasMoreTokens() ? ((Object) (items.nextToken())) : null)) {
            items = new StringTokenizer(entrys.nextToken(), "=");
        }
        return docType;
    }

    private String reIds(String allIds, String ids) {
        if (StringUtils.isNotEmpty(ids)) {
            if (StringUtils.isNotEmpty(allIds)) {
                allIds = allIds + "," + ids;
            } else {
                allIds = ids;
            }
        }
        return allIds;
    }

    private List<GameAttribute> getGameAttributs(String ids) {
        if (StringUtils.isEmpty(ids)) {
            return new ArrayList<>();
        }
        return gameAttributeMapper.selectGameAttributeListByIds((Long[]) ConvertUtils.convert(ids.split(","),
                Long.class));
    }

    static String jccxxyx = "{\"msg\":\"操作成功\",\"code\":0,\"succ\":true,\"data\":[{\"id\":6552,\"gameid\":2648,\"gamename\":\"金铲铲之战\",\"rolename\":\"心之钢小小永恩\"},{\"id\":6553,\"gameid\":2648,\"gamename\":\"金铲铲之战\",\"rolename\":\"至臻格温\"},{\"id\":6554,\"gameid\":2648,\"gamename\":\"金铲铲之战\",\"rolename\":\"至臻风女\"},{\"id\":6555,\"gameid\":2648,\"gamename\":\"金铲铲之战\",\"rolename\":\"灵魂莲花小小永恩\"},{\"id\":6556,\"gameid\":2648,\"gamename\":\"金铲铲之战\",\"rolename\":\"至臻亚索\"},{\"id\":6557,\"gameid\":2648,\"gamename\":\"金铲铲之战\",\"rolename\":\"至臻神龙尊者李青\"},{\"id\":6558,\"gameid\":2648,\"gamename\":\"金铲铲之战\",\"rolename\":\"神龙尊者 昼日真龙 亚索\"},{\"id\":6559,\"gameid\":2648,\"gamename\":\"金铲铲之战\",\"rolename\":\"神龙尊者 夜月幻龙\"},{\"id\":6560,\"gameid\":2648,\"gamename\":\"金铲铲之战\",\"rolename\":\"大胡子喵\"},{\"id\":6561,\"gameid\":2648,\"gamename\":\"金铲铲之战\",\"rolename\":\"魔典爆爆\"},{\"id\":6562,\"gameid\":2648,\"gamename\":\"金铲铲之战\",\"rolename\":\"至臻薇恩\"},{\"id\":6563,\"gameid\":2648,\"gamename\":\"金铲铲之战\",\"rolename\":\"电玩女神 凯特琳\"},{\"id\":6564,\"gameid\":2648,\"gamename\":\"金铲铲之战\",\"rolename\":\"EDG 佐伊\"},{\"id\":6565,\"gameid\":2648,\"gamename\":\"金铲铲之战\",\"rolename\":\"星之守护者 拉克丝\"},{\"id\":6566,\"gameid\":2648,\"gamename\":\"金铲铲之战\",\"rolename\":\"臻玉剑传说 艾瑞莉娅\"},{\"id\":6567,\"gameid\":2648,\"gamename\":\"金铲铲之战\",\"rolename\":\"剪纸仙灵 小小格温\"},{\"id\":6568,\"gameid\":2648,\"gamename\":\"金铲铲之战\",\"rolename\":\"龙腾虎跃 瑟提\"},{\"id\":6569,\"gameid\":2648,\"gamename\":\"金铲铲之战\",\"rolename\":\"魔典 琴女\"},{\"id\":6570,\"gameid\":2648,\"gamename\":\"金铲铲之战\",\"rolename\":\"星之守护者 阿狸\"},{\"id\":6571,\"gameid\":2648,\"gamename\":\"金铲铲之战\",\"rolename\":\"灵魂莲华 提莫\"},{\"id\":6572,\"gameid\":2648,\"gamename\":\"金铲铲之战\",\"rolename\":\"神龙尊者 卡莎\"},{\"id\":6573,\"gameid\":2648,\"gamename\":\"金铲铲之战\",\"rolename\":\"香水宝石 奥利安娜\"},{\"id\":6574,\"gameid\":2648,\"gamename\":\"金铲铲之战\",\"rolename\":\"香水宝石 瑞雯\"},{\"id\":6575,\"gameid\":2648,\"gamename\":\"金铲铲之战\",\"rolename\":\"至臻 星辰鳞珑\"},{\"id\":6576,\"gameid\":2648,\"gamename\":\"金铲铲之战\",\"rolename\":\"银河三连星\"},{\"id\":6577,\"gameid\":2648,\"gamename\":\"金铲铲之战\",\"rolename\":\"DRX 艾希\"},{\"id\":6578,\"gameid\":2648,\"gamename\":\"金铲铲之战\",\"rolename\":\"甜心之翊 洛\"},{\"id\":6579,\"gameid\":2648,\"gamename\":\"金铲铲之战\",\"rolename\":\"甜心之羽 霞\"},{\"id\":6580,\"gameid\":2648,\"gamename\":\"金铲铲之战\",\"rolename\":\"神王 盖伦\"},{\"id\":6581,\"gameid\":2648,\"gamename\":\"金铲铲之战\",\"rolename\":\"神王 德莱厄斯\"},{\"id\":6582,\"gameid\":2648,\"gamename\":\"金铲铲之战\",\"rolename\":\"玉剑传说 泰隆\"},{\"id\":6583,\"gameid\":2648,\"gamename\":\"金铲铲之战\",\"rolename\":\"玉剑传说 刀妹\"},{\"id\":6584,\"gameid\":2648,\"gamename\":\"金铲铲之战\",\"rolename\":\"神龙烈焰 金克丝\"},{\"id\":6585,\"gameid\":2648,\"gamename\":\"金铲铲之战\",\"rolename\":\"战斗学院 凯特琳\"},{\"id\":6586,\"gameid\":2648,\"gamename\":\"金铲铲之战\",\"rolename\":\"战斗学院 杰斯\"},{\"id\":6587,\"gameid\":2648,\"gamename\":\"金铲铲之战\",\"rolename\":\"未来战士 伊泽瑞尔\"},{\"id\":6588,\"gameid\":2648,\"gamename\":\"金铲铲之战\",\"rolename\":\"源计划 卡特琳娜\"},{\"id\":6589,\"gameid\":2648,\"gamename\":\"金铲铲之战\",\"rolename\":\"源计划 卢锡安\"},{\"id\":6590,\"gameid\":2648,\"gamename\":\"金铲铲之战\",\"rolename\":\"蔬菜精灵白菜狗\"},{\"id\":6591,\"gameid\":2648,\"gamename\":\"金铲铲之战\",\"rolename\":\"斗魂觉醒 拉克丝\"},{\"id\":6592,\"gameid\":2648,\"gamename\":\"金铲铲之战\",\"rolename\":\"太空律动 璐璐\"},{\"id\":6593,\"gameid\":2648,\"gamename\":\"金铲铲之战\",\"rolename\":\"DRX 凯特琳\"}]}";

}
